Shampoo (Gupta et al., 2018) preconditions a matrix gradient on both sides, using a running sum of G G^T on the left and G^T G on the right. Those sums capture the curvature along each axis.
Implement accumulate_preconditioners(L, R, G), adding the two gram matrices of the gradient.
Add G times G transposed to L, and G transposed times G to R.
No results yet
Run your code to check it against the examples, or submit to run every test.