Connection between sensitivity algorithm and gradient calculation of the loss function

I’m new to Julia and ML and try to understand the basics.

I have defined an ODE problem with 2 parameters. This is used for the prediction in my loss function. This loss function is now used in turn to optimize the parameters of my ODE using DiffEqFlux.sciml_train (loss, … BFGS (), …).
Now I have discovered the local sensitivity analysis in the documentation:

but didn’t quite understand what is happening.
Can I use the sensitivity algorithm to determine how the gradient of my loss function is calculated?
I understood that the sciml_train function uses zygote and reverse-mode AD by default.
Or does the sensitivity analysis not refer to the loss function?

Any help is highly appreciated :blush: :thinking:

It’s doing that automatically.

The default is a lot more complicated. With 2 parameters, it probably automatically switched to forward sensitivities.

Thank you for your help, but I still need some information to understand. If I add a sensealg to my prediction, what does it do?

It overrides the default and chooses which sensitivity method to use.

To calculate the gradients of my loss function at every data point?


Thank you, now I finally get it! Sorry for the clumsy language, I am not very fluent in english