0
0

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.

強化学習39 Colaboratory+ Breakout + chainerRL GPUを使う

Posted at

中学生から大学生までのAI初学者を対象にしています。
強化学習38まで終了していることを前提にします。

このシリーズも、ついにGPGPUに突入です。
ChainerRL/examples/atari/train_dqn_ale.py
を改造して使います。改造したものは、
chokozainerRL/train_dqn_ale.py
に入れておきました。
Colaboratory notebookは、github/chokozainerの
dqn_ale.ipynbsを使用してください。

こちらのdqnは、NatureDQNを使っています。
こちらと同程度と推測されます。
https://chainer-colab-notebook.readthedocs.io/ja/latest/notebook/hands_on/chainerrl/atari_sample.html
こちらでは、11時間かかると紹介されていましたが、もう少しかかる印象です。

最初に考えるべきは、時間です。
こちらを参考にしてください。
https://qiita.com/tomo_makes/items/b3c60b10f7b25a0a5935
90分ルールと12時間ルールがあるので、途中でセーブする必要があります。
結論から言うと100000stepsで、約10分間かかります。
10000000stepが推奨されているようですが、1000分間=16時間くらいは必要になります。
でも、300000stepでそれなりに学習は進みますので、5時間くらいあれば、なんとなく雰囲気はつかめます。

次に容量です。
1回のバックアップ保存で、約30Mbのファイルができます。なので、100000〜500000stepsの間でバックアップサイクルを決めるといいでしょう。
chokozainerRLでは、args.checkout_frequencyで設定します。

最後に、途中からの学習です。
直前のバックアップが、「376842_except」だったとします。

args.load_agent=thisdir+"/376842_except"
args.step_offset=376842

のように設定すると途中から実行されます。

面倒だったので、3500000stepsで終了しましたが、max174まで学習できました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?