3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

keras-rlとOpenAI Gymで強化学習( breakoutサンプル)

Last updated at Posted at 2018-02-10

はじめに

今回はkeras-rlとOpenAI Gymで強化学習を試します。今回は数年前にdeepmindのvideoでも紹介されていた breakout です。

参考にしたコードなど

 breakoutサンプルについては、下記のgithubを参考にさせていただきました。

https://github.com/openai/gym
https://github.com/matthiasplappert/keras-rl/blob/master/examples/dqn_atari.py

breakout サンプル

 はまったところは一点だけ。cmakeが入っていないと gym[atari] のインストールでエラーになる。cmakeが必要なことは、githubのREADMEにはしっかり書いてあり、私が読んでなかっただけです。
 また、jupyter-notebookで動かすため、引数周りのコードを変更しました。書き換えたコードは下記に置きました。

https://github.com/kznx/kznxtest/blob/master/atari_01.py
 

トレーニング結果

 デフォルトの1750000step完了には、13時間ほどかかりました。本格的な強化学習にはGPUは必須な様です。

最後に

 breakoutサンプルを試してみました。もう少しstepを増やせばdeepmindが公開していたvideoぐらい上手くなるかもしれません。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?