Code Monkey home page Code Monkey logo

rl's Introduction

Reinforcement Learning Library

This repository aims to contain the latest reinforcement learning algorithms implemented using Tensorflow, Keras and OpenAI Gym.

Currently, A3C has been implemented.

Requirements

  • Python 3.5
pip install -r requirements.txt

Usage

agent = A3CAgent(num_actions, lambda: model)
agent.train(env_name)

Tensorboard Logging

tensorboard --logdir=out --reload_interval=2

Sources:

rl's People

Contributors

calclavia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

trinhvo

rl's Issues

Error while saving (a3c example)

While trying the a3c example provided I encountered the following error:

Training model
Training ACAgentRunner...
[2017-04-10 16:30:50,699] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:51,751] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:52,808] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:53,878] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:54,935] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:56,057] Making new env: CartPole-v0
Training ACAgentRunner...
[2017-04-10 16:30:57,118] Making new env: CartPole-v0
Training ACAgentRunner...
Exception in thread Thread-20:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/jsteffen/rl-master/rl/util.py", line 30, in save_worker
    agent.save(sess)
  File "/home/jsteffen/rl-master/rl/a3c.py", line 223, in save
    self.model.model.save_weights(self.model_path + '/model_' + str(self.save_count) + '.h5')
  File "/home/jsteffen/venv3/lib/python3.5/site-packages/keras/engine/topology.py", line 2465, in save_weights
    save_weights_to_hdf5_group(f, self.layers)
  File "/home/jsteffen/venv3/lib/python3.5/site-packages/keras/engine/topology.py", line 2715, in save_weights_to_hdf5_group
    weight_values = K.batch_get_value(symbolic_weights)
  File "/home/jsteffen/venv3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1977, in batch_get_value
    return get_session().run(ops)
  File "/home/jsteffen/venv3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 767, in run
    run_metadata_ptr)
  File "/home/jsteffen/venv3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in _run
    raise RuntimeError('The Session graph is empty.  Add operations to the '
RuntimeError: The Session graph is empty.  Add operations to the graph before calling run().

Training using recurrent networks?

Hi, I see that you have already thought of implementing some kind of "recurrentness" using the time_steps parameter.

Is it possible to train a stateful model (i.e., having data in shape as (batch_size, time_steps, features)) and resetting the state of, e.g., an lstm layer, for experience replay?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.