Efficient Computation of Hessian Matrices in TensorFlow

Geir K. Nilsen, Antonella Z. Munthe-Kaas, Hans J. Skaug, Morten Brun
5/14/2019
cs.LG

Official code: gknilsen/pyhessian (25 stars, GPL-3.0, last commit 2021-03-26).

Abstract

The Hessian matrix has a number of important applications in a variety of different fields, such as optimzation, image processing and statistics. In this paper we focus on the practical aspects of efficiently computing Hessian matrices in the context of deep learning using the Python scripting language and the TensorFlow library. We define a general feed-forward neural network model and show how to efficiently compute two quantities: the cost function's exact Hessian matrix, and the cost function's approximate Hessian matrix, known as the Outer Product of Gradients (OPG) matrix. Furthermore, as the number of parameters (weights and biases) in deep learning usually is very large, we show how to reduce the quadratic space complexity by an efficient implementation based on approximate eigendecompositions.

View on arXivView PDF

Code Implementations(1)

gknilsen/pyhessianOfficial100%
GPL-3.0

pyhessian is a TensorFlow module which can be used to estimate Hessian matrices

2512PythonApr 3, 20195 years agoGPL-3.0

Cite this paper

@article{nilsen2019efficient,
  title  = {Efficient Computation of Hessian Matrices in TensorFlow},
  author = {Geir K. Nilsen and Antonella Z. Munthe-Kaas and Hans J. Skaug and Morten Brun},
  year   = {2019},
  eprint = {1905.05559},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1905.05559}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1905.05559.svg)](https://codeofpaper.com/paper/1905.05559)

Discussion