Comments (2)
So I decided to use this library and I am currently writing my own vanilla policy gradient. It seems that the td3 algorithm has the assumption that the state of the environment doesn't automatically get changed due to an observation/action, but with my plan for my project I was going to have it make an observation, and then make an action and get a reward approximately one fixed eval period later, so I figured I couldn't have the two critics making observations and getting rewards as the state would have changed.
from rl-tools.
Hi @DaxLynch sorry for the late reply. That sounds like a very cool project! Since TD3 is an off-policy method you can populate the replay buffer however you like. I would suggest to create your own training loop by copying the operations from here:
But removing the step(device, ts.off_policy_runner, ts.actor_critic.actor, ts.actor_buffers_eval, ts.rng);
where the off-policy runner is used to generate samples from the environment and place them into the replay buffer.
Then you can have your own code using the policy to generate actions (like e.g. in the evaulation code:
). Once you have collected the[state, observation, action, reward, next_state, next_observation, terminated_flag, truncated_flag]
tuple you can add it to the replay buffer like in It is probably best to do a full rollout of the trajectory and then, when the robot is idle, do some steps of training to prevent the training to interfere with the control frequency.
I think this is a common use-case (where the interaction/inference can not be in lock-step with and governed by the training loop) and I'm thinking of ways to better accommodate it. Once I find some time, I'll probably separate out the rollouts of the off-policy runner into a separate loop so that it can be optional and create an example where the rollouts are conducted independently of the training
from rl-tools.
Related Issues (7)
- How to save weights to a file HOT 5
- Invalid Link to Crazyflie Platform in README File HOT 2
- Load compiled model error HOT 11
- A few questions... HOT 1
- Reporting an issue for your example(Teensy 4.1) and asking for your help to add an example for new esp32-s3 ... HOT 6
- Use PC training results on Microcontroller HOT 2
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 rl-tools.