cavis/rl4j
Chris Bamford 74420bca31
RL4J: Sanitize async learner (#327)
* refactoring global async to use a much simpler update procedure with a single global lock

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* simplification of async learning algorithms, stabilization + better hyperparameters

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* started to play with using mockito for tests

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* Working on refactoring tests for async classes and trying to make async simpler

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* more work on mockito tests and making some tests much less complex and more explicit in what they are testing

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* some fixes from merging

* do not allow copying of the current network to worker threads, fixing debug line

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* adding some more tests around PR review

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* Adding more tests after review comments

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

* few more tests and fixes from PR review

* remove rename of maxEpochStep to maxStepsPerEpisode as we agreed to review this in a seperate PR

* 2019 instead of 2018 on copyright header

* adding konduit copyright to files

* some more copyright headers

Signed-off-by: Bam4d <chrisbam4d@gmail.com>

Co-authored-by: Alexandre Boulanger <aboulang2002@yahoo.com>
2020-04-20 11:21:01 +09:00
..
contrib Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00
rl4j-ale RL4J: Replace gym-java-client with JavaCPP (#8595) 2020-01-20 17:13:57 +09:00
rl4j-api RL4J: Sanitize async learner (#327) 2020-04-20 11:21:01 +09:00
rl4j-core RL4J: Sanitize async learner (#327) 2020-04-20 11:21:01 +09:00
rl4j-doom RL4J: Replace gym-java-client with JavaCPP (#8595) 2020-01-20 17:13:57 +09:00
rl4j-gym RL4J: Use Py_AddPath() instead of Py_SetPath() in GymEnv (issue #8688) 2020-02-19 00:31:12 +09:00
rl4j-malmo RL4J: Add Backwardly Compatible Builder patterns (#326) 2020-04-06 12:36:12 +09:00
LICENSE.txt Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00
README.md RL4J: Replace gym-java-client with JavaCPP (#8595) 2020-01-20 17:13:57 +09:00
cartpole.gif Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00
doom.gif Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00
malmo.gif Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00
pom.xml RL4J: Replace gym-java-client with JavaCPP (#8595) 2020-01-20 17:13:57 +09:00
scoregraph.png Eclipse Migration Initial Commit 2019-06-06 15:21:15 +03:00

README.md

RL4J: Reinforcement Learning for Java

RL4J is a reinforcement learning framework integrated with deeplearning4j and released under an Apache 2.0 open-source license. By contributing code to this repository, you agree to make your contribution available under an Apache 2.0 license.

  • DQN (Deep Q Learning with double DQN)
  • Async RL (A3C, Async NStepQlearning)

Both for Low-Dimensional (array of info) and high-dimensional (pixels) input.

DOOM

Cartpole

Here is a useful blog post I wrote to introduce you to reinforcement learning, DQN and Async RL:

Blog post

Examples

Cartpole example

Disclaimer

This is a tech preview and distributed as is. Comments are welcome on our gitter channel: gitter

Quickstart

  • mvn install

Visualisation

webapp-rl4j

Quicktry cartpole:

  • run with this main

Doom

Doom is not ready yet but you can make it work if you feel adventurous with some additional steps:

  • You will need vizdoom, compile the native lib and move it into the root of your project in a folder
  • export MAVEN_OPTS=-Djava.library.path=THEFOLDEROFTHELIB
  • mvn compile exec:java -Dexec.mainClass="YOURMAINCLASS"

Malmo (Minecraft)

Malmo

  • Download and unzip Malmo from here
  • export MALMO_HOME=YOURMALMO_FOLDER
  • export MALMO_XSD_PATH=$MALMO_HOME/Schemas
  • launch malmo per instructions
  • run with this main

WIP

  • Documentation
  • Serialization/Deserialization (load save)
  • Compression of pixels in order to store 1M state in a reasonnable amount of memory
  • Async learning: A3C and nstep learning (requires some missing features from dl4j (calc and apply gradients)).

Author

Ruben Fiszel

Proposed contribution area:

  • Continuous control
  • Policy Gradient
  • Update rl4j-gym to make it compatible with pixels environments to play with Pong, Doom, etc ..