Closed lxuechen closed 4 years ago
A side note is that we should squash the commits when we merge this.
Also, I think the gdg_jacobian_contraction
can be implemented by doing a loop / batch trick [my terminology for your fast Jacobian trick] over vjp
rather than jvp
, which would be worth doing what with PyTorch.
Also, I think the gdg_jacobian_contraction can be implemented by doing a loop / batch trick [my terminology for your fast Jacobian trick] over vjp rather than jvp, which would be worth doing what with PyTorch.
Feel free to give this a go.
I've decided to go with the jvp implementation.
I implemented two versions: One with better memory scaling and the other with better time scaling. I'll send some more discussions via email.
I've only added a simple test. The numerical checks pass. The efficient version is much faster than the loop version on CPU.