Is a way to calculate the Hessian of the loss function in Mathematica. It's easy to define a loss function for neural nets but I couldn't figure out how to calculate the Hessian(more precisely I wanted to get access to eigenspectrum of Hessian). There are scientific papers, where they calculate Hessian of a loss using python(autograd (auto differentiation) algorithm).
The idea here to train a neural net for few epochs (say on a simple fully connected net or simplified LeNet) and then calculate the Hessian of the loss function.
Addendum: Here's one such paper: https://arxiv.org/pdf/1611.07476.pdf
NetTrainand then get 1st Gradient withNetGradient[{position of the layer,"Weights"}]– Xminer Jul 03 '19 at 21:21