Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for getting the gradients with respect to model parameters #44

Open
ChiyenLee opened this issue Apr 28, 2022 · 4 comments
Open

API for getting the gradients with respect to model parameters #44

ChiyenLee opened this issue Apr 28, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@ChiyenLee
Copy link

Is there a way to get access to gradients with respect to a mechanism's model parameters like inertia, mass, and center of mass?

@simon-lc
Copy link
Member

Yes there is a way to do this.
This file computes the the gradient of the residual wrt to the mechanism data = (previous state, control input, mass inertia, etc).

https://github.com/dojo-sim/Dojo.jl/blob/main/src/gradients/data.jl

@simon-lc
Copy link
Member

then to get the gradient of the next state wrt to the mass, inertia. You'll need to implement something like get_maximal_gradients
https://github.com/dojo-sim/Dojo.jl/blob/main/src/gradients/state.jl

this means using the Iplicit function theorem i.e. computing d next_state/ d data = -d residual /d next_state ^-1 * d residual / d data

@simon-lc
Copy link
Member

I can help you set this up if you want to work on this!

@zpatty
Copy link

zpatty commented May 6, 2022

+1 on this as a desired feature. I'd be willing to help set it up in my spare time.

@janbruedigam janbruedigam added the documentation Improvements or additions to documentation label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants