Open dawgster opened 5 years ago
I don't have the "silver bullet' solution to your problem, but a few thoughts and potential leads (I hope)
There's a lot going on here - can you uncomplicate your code and try differentiating smaller chunks to aid in debugging?
I could be reading your calls incorrectly, but I believe that you want to differentiate
getStateDerivative(self, X, U)
with respect to X
and U
- is that correct? If so then the jacobian
call here
self.getLinearizedModelAutoGrad = jacobian(VehicleModel.getStateDerivative, argnum=(1, 2))
should produce an error due to indexing - I believe you want argnum=(0, 1)
not argnum=(1, 2)
.
X
and U
should be transformed into autograd
-numpy
arrays. Inputing each as a list might cause a problem depending on what you're doing inside getStateDerivative
Hi! When trying to get the Jacobian of a function i get the following error:
Here is how I have the Jacobian set up:
self.getLinearizedModelAutoGrad = jacobian(VehicleModel.getStateDerivative, argnum=(1, 2)
)Example of how I call it:
model.getLinearizedModelAutoGrad(model, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
And finally the function I'm trying to get the Jacobian of (sorry, not experienced enough with Autograd yet to tell which information is relevant here):
I'm using the current version provided by pip. I would be very grateful for any input on this problem. Thanks and have a happy new year!