PPO-PyTorch | Minimal implementation of clipped objective Proximal Policy Optimization (PPO) in PyTorch | Reinforcement Learning library
kandi X-RAY | PPO-PyTorch Summary
kandi X-RAY | PPO-PyTorch Summary
This repository provides a Minimal PyTorch implementation of Proximal Policy Optimization (PPO) with clipped objective for OpenAI gym environments. It is primarily intended for beginners in Reinforcement Learning for understanding the PPO algorithm. It can still be used for complex environments but may require some hyperparameter-tuning or changes in the code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Train the model
- Update Monte Carlo model
- Select a single action
- Evaluate the objective function
- Decrement the action standard deviation
- Calculate the action distribution
- Set action standard deviation
- Clears the history
- Saves the current state of the current state to checkpoint_path
- Saves gif images
- Load state from checkpoint file
- Saves the graph to disk
- Save images to gif
- Lists the size of the gif
PPO-PyTorch Key Features
PPO-PyTorch Examples and Code Snippets
Community Discussions
Trending Discussions on PPO-PyTorch
QUESTION
I have tried to implement Proximal Policy Optimization with Intrinsic Curiosity Rewards for statefull LSTM neural network.
Losses in both PPO and ICM are diverging and I would like to find out if its bug in code or badly selected hyperparameters.
Code (where some wrong implementation could be):- In ICM model I use first layer LSTM too to match input dimensions.
- In ICM whole dataset is propagated at once, with zeros as initial hidden(resultin tensors are different, than they would be if I propagated only 1 state or batch and re-use hidden cells)
- In PPO advantage and discount reward processing the dataset is propagated one by one and hidden cells are re-used (exact opposite than in ICM because here it uses same model for selecting actions and this approach is "real-time-like")
- In PPO training model is trained on batches with re-use of hidden cells
I have used https://github.com/adik993/ppo-pytorch as default code and reworked it to run on my environment and use LSTM
I may provide code samples later if specifically requested due to large amount of rows
Hyperparameters: ...ANSWER
Answered 2019-Jul-13 at 14:01Found the problem... In main model I use softmax for eval runs and log_softmax for training in output layer and according to PyTorch docs the CrossEntropyLoss uses log_softmax inside, so as advised I used NLLLoss but forthe computation of ICM model loss which does not have softmax fnc in output layer! So switching back to CrossEntropyLoss (which was originaly in reference code) solved ICM loss divergence.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PPO-PyTorch
You can use PPO-PyTorch like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page