LoginSignup
3
2

More than 5 years have passed since last update.

強化学習をKeras-RLで実装したい(mac環境)

Last updated at Posted at 2018-07-09

前段階として最低限のものをインストール

pythonのバージョンは3.5.0を使用しています
python 2系だと僕はうまく稼働しなかったので参考にしてください

以下のサイトを参考にさせていただきました
https://qiita.com/takeruw/items/3540c1c618d5459195ad

基本的にホームディレクトリで実行する

  1. openAIGym
  2. Keras-RL

注)terminalでcd ~と実行して移動した先がホームディレクトリです

1 openAIGymのインストール

terminalで以下を実行

git clone https://github.com/openai/gym.git
cd gym
pip install -e .

ここでterminalでpythonを起動

import gym

で問題なければOK!
ここまででopenAIGymをインストールできた.

次に2 Keras-RLをインストールする

keras-rlを使用する際にkeras,tensorflow,keras-rlが必要となる
terminalで以下を実行

pip install keras

pip install tensorflow

git clone https://github.com/matthiasplappert/keras-rl.git
pip install ./keras-rl

実行後に

python keras-rl/examples/dqn_cartpole.py

でエラーなく動作ができたらOK!

3
2
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
2