Giter Club home page Giter Club logo

rl-ppo-keras's Introduction

RL-PPO-Keras

This is an implementation of proximal policy optimization(PPO) algorithm with Keras.

Usage

Start an experiment:

python main.py

Code

  • run_exp.py

    Create environment and agent. Agent interacts with enviornment and learns with samples.

  • config.py

    Configuration about agent, environment, experiment, and path.

  • ppo.py

    Implementation of PPO algorithm.

rl-ppo-keras's People

Contributors

liziniu avatar

Stargazers

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

Watchers

 avatar

rl-ppo-keras's Issues

Loading models doesn't work

Hoping that this project is not abandoned and you're willing to patch this:
When trying to load a saved model using the Agent.load_model method it will throw the exception: 'keras load ValueError: Unknown loss function:loss'

The regular solution is to change the line:
self.actor_network = load_model(self.dic_path["PATH_TO_MODEL"], "%s_actor_network.h5")
(which I already changed to): self.actor_network = load_model("ppo/actor_network.h5")
to:
self.actor_network = load_model("ppo/actor_network.h5", custom_objects={'loss': self.loss})

However because the loss function is an inner function that cannot be called. When trying to use use proximal_policy_optimization_loss(which generates the loss function) instead it'll throw the exception: 'AttributeError: 'function' object has no attribute 'get_shape'

I've been trying to fix this by:
loading weights rather then the model
creating a lose loss function using self.parameters within
creating a lose loss function and use lampda https://stackoverflow.com/a/54177997/8579225

but I can't seem to fix things.
Hope you are willing to help me out with this.

shared layers

Hi,
I think this function: _shared_network_structure is not doing what we expect
actually this adds different layers with different parameters each time we call it, not shared layer

gym version

After trying, gym 0.26.2 does not work, I reduce the use of 0.25.2 is feasible

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.