This repo provides examples of deep reinforcement learning in julia (v1.0 and above) using Knet deep learning library and OpenAI Gym. Contributions are very welcome!
Install the gym
environment for python
pip install --user gym[atari]
and the julia packages Gym.jl and Knet
] add Gym Knet
You are now ready to run any of the examples in the repo. You can clone the whole repo with
git clone https://github.com/CarloLucibello/DeepRLexamples.jl
include("actor_critic_pong.jl")
main(seed=17, episodes=1000, lr=1e-2, render=true, infotime=50)
-
reinforce_cartpole.jl: reinforce algorithm with a multi-layer perceptron. CPU only.
-
actor_critic_cartpole.jl: actor critic algorithm with a multi-layer perceptron. CPU only.
-
actor_critic_pong.jl: actor critic algorithm with a convolutional neural network. Following Karphaty's blog entry, but using actor-critic instead of simple police gradient. Also, a convolutional neural network instead of a multi-layer perceptron. Runs on both CPU and GPU.