ppo-pytorch | Machine Learning library
kandi X-RAY | ppo-pytorch Summary
kandi X-RAY | ppo-pytorch Summary
ppo-pytorch
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sample from the experiment
- Create an Observation object
- Read server data
- Resets the experiment to Torcs
- Convert observation to RGB image
- Train the model
- Collects samples from the given agents
- Get weights
- Forward normalization function
- Calculate the log - normal density
- Return a fancy output
- Generate a bargraph
- Evaluate the given action
- Evaluate the critic
- Evaluate the given action function
- Compute the log - likelihood at x
- Read data from server
- Run a policy
- Convert a gif to a gif
- Generate an example
- Generate a trajectory
- Perform a Poisson Update
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