ACEsuit / Polynomials4ML.jl

Polynomials for ML: fast evaluation, batching, differentiation
MIT License
12 stars 5 forks source link

2nd-order rrules #49

Closed cortner closed 1 year ago

cortner commented 1 year ago

This PR is to explore how to implement second-order rrules.

Most urgently, this will allow us to train nonlinear ACE potentials on forces. In the future, we may also use it for training any ACE type model on something that is differentiates (forces, sensitivies...)

cortner commented 1 year ago

Along the way it would be good to also finalize the pullback interface. At the moment, I tentatively suggest,

evaluate(basis, X) 
_pb_evaluate(basis, Δ, X) 
_pb_pb_evaluate(basis, Δ2, Δ, X) 

the _rrule_evaluate(...) interface should just be removed - we can rrule(evaluate, ...) instead.

cortner commented 1 year ago

this seems ready to merge as soon as #50 and #51 are finished.

cortner commented 1 year ago

@CheukHinHoJerry -- this is ready to merge I think. I'm flagging it because this changes the internals quite a bit, especially the SparseSymmProdDAG and SparseSymmProd. If you are using any internal properties of those in any of your codes, this is the moment to discuss it.