Sophia needs the Hessian diagonal, but forming the full Hessian is too costly. The Hutchinson estimator uses random +1 and -1 probes: multiplying a Hessian-vector product by the probe, element-wise, gives an unbiased diagonal estimate.
Implement hutchinson_estimate(Hu, u), the element-wise probe times the Hessian-vector product.
Multiply the Hessian-vector product by the probe, element by element.
No results yet
Run your code to check it against the examples, or submit to run every test.