erwincoumans / tiny-differentiable-simulator

Tiny Differentiable Simulator is a header-only C++ and CUDA physics library for reinforcement learning and robotics with zero dependencies.
Apache License 2.0
1.2k stars 129 forks source link

Differentiable reward functions? #124

Closed sgillen closed 3 years ago

sgillen commented 3 years ago

Is it possible to make an environment using TDS such that the reward function is differentiable? It seems like if the reward in question is just a direct output from the simulator (maybe just the velocity along a certain axis), or if I construct the reward function using some of the functionality provided in src/math etc that this should be possible, but perhaps I am misunderstanding something.

sgillen commented 3 years ago

Well, I answered my own question, you clearly can do this and there are even examples. I was just a bit confused by the code in examples/environments/. It seemed like the step() functions were all stuck using doubles and not differentiable