Comments (6)
Thank you for your help! Yes close the issue there are no further issues!
from ppo-for-beginners.
Let me add that in stablebaselines3 I am able to complete the task. Success is increasing and episode length is decreasing which are both an indication of the model learning.
from ppo-for-beginners.
Hi Nikolas, thanks for using my implementation! I want to test your code locally (also because it's hard to tell what's wrong from just looking at it), but want to ask a few questions:
- What are your imports for each file?
- Where is init_weights in
self.apply(init_weights)
defined? - What values do you input to PPO constructor?
Will probably ask more along the way, but just want these clarifications for now.
from ppo-for-beginners.
Thank you for your answer Eric! To give you more information I have a custom gym environment in using pybullet for a pick and place task. The action space is discrete that denotes approach and grasp an object and finally move it to a target location so 0, 1, 2 respectively. The actual robot movements are hardcoded.
- The import for each file are the regular imports torch, numpy etc. I am not sure why you are asking this so until you get back this is my answer!
- It is defined in a file where the models used for the policy are defined and that initialises the weights of the policy.
def init_weights(m):
class_name = m.__class__.__name__
if class_name.find("Linear") != -1:
torch.nn.init.xavier_normal_(m.weight)
- The values are the environment on which to train the policy, the policy network, the learning rate (3e-4), betas passed to Adam optimizer (0.9, 0.999), the GAE lambda (0.95), clip range for the loss (0.2), the entropy coefficient (0.01) if I am correct you don't use this and it is easy to remove it for my case, the value loss coefficient (0.5), the max grad norm (0.5), the number of timsteps per update (2000) and the number of updates of the policy (5). Finally I pass in the tensorboard summary writer from Pytorch.
Is my implementation of PPO with GAE correct? I struggle to get a handle of how to manipulate all the data structures. I can try to run the code without GAE and simply use the advantage to see the effect if any.
from ppo-for-beginners.
@ericyangyu I remove the GAE implementation from the loss function and the implementation works. So it seems my GAE implementation had errors, at least that is my assumption. It seems to work well like this anyway!
from ppo-for-beginners.
This is great news Nikolas! Glad you were able to figure out your issue :) Apologies for the previous post, I meant to remove question 1 since question 2 was supposed to be the replacement. I'm going to go ahead and close this issue soon if there are no further issues.
from ppo-for-beginners.
Related Issues (8)
- The average Episodic Return and Average Loss is nan HOT 4
- the python version of this repo? HOT 1
- ImportError: libboost_filesystem.so.1.65.1 in Collab HOT 1
- How to fix: Broken with latest gym pip package HOT 1
- covariance matrix HOT 1
- Using for custom environment with different actions HOT 1
- why critic's loss is mean squared error of the predicted values with rewards-to-go. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ppo-for-beginners.