Jacobian of State Dynamics #527
Replies: 4 comments
-
Hi @Jaldrich2426 - which pipeline are you using? Yes, I would expect the jacobian wrt state to give meaningful results. Can you post a colab or code snippet? |
Beta Was this translation helpful? Give feedback.
-
Thanks @erikfrey! I'm working off a trimmed-down example of this notebook here. I've primarily been testing in the positional pipeline but tried using the others with no luck. I've also moved to using the observation instead of the pipeline state since it contains the pipeline's state's position and velocity (q and qd) in this example. Here's my trimmed version:
|
Beta Was this translation helpful? Give feedback.
-
Update: the issue ended up being twofold The Jacobian of a state with respect to the previous state seems to only function on the generalized pipeline and does not propagate the value to the observation field. To remedy this, you can take the For example, if you want to use the observation field, you can create a gradient version of your environment's
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the investigation @Jaldrich2426 ! Converting this to a discussion thread for others to find |
Beta Was this translation helpful? Give feedback.
-
Hi, In a similar direction to #83, I'm attempting to use Brax for a form of optimal control, but I need access to the Jacobian of the dynamics step function with respect to both the input state and action. Specifically, if
I'd like the jacobian of
new_state
with respect to certain elements instate
, and the jacobian ofnew_state
with respect toaction
. If this were a linear model underI'd want
A
andB
. For the ant sample environment, I was able to compute a gradient with respect toaction
by defining a helper step function ofand calling
However, attempting to achieve similar results for relevant fields of the state (q in this example)
yields an all 0's result. Is there a better way to compute these jacobians, and is this supported behavior by Brax?
Beta Was this translation helpful? Give feedback.
All reactions