Open avhz opened 1 year ago
@avhz Hi, I am not familiar with the codebase but I will try to figure something out in the next couple of days. Any specific reason why this issue is considered difficult?
Jacobian matrices shouldn't be too bad to implement (just a collection of gradients) but I have not figured out higher order derivatives. From what I've read it's a lot more work.
I have looked through and I am interested in tackling this issue, but will need a bit of time, since I just recently started playing with Rust and have plenty of knowledge gaps to fill...
.accumulate
method on VariableArray
instance. I was not able to verify that it works yet though.The two best references I know of are:
The VariableArray
object is really a WIP and does not actually work as intended, since we can't fill ndarray
s (nor nalgebra matrices/vectors) with the Variable
type.
Applying accumulate
to a vector output function should be all that needs to happen, just with a nice/intuitive API.
The last point about the Hessian is what would be ideal, but since the current methods return f64
s not Variables
, we can't apply it twice.
For Hessian accumulation, there are 3 modes: forward-over-reverse, reverse- over-forward, and reverse-over-reverse.
We would have to do the last, since forward is not implemented.
Currently only gradients can be computed via the
RustQuant::autodiff
module. Adding support for full Jacobians and also higher-order derivatives like the Hessian would be nice.