Skip to main content

Hessian-free optimization for deep networks

Project description

Based on

Martens, J. (2010). Deep learning via Hessian-free optimization. In Proceedings of the 27th International Conference on Machine Learning.

Setup

Quick start

To install the package, open a command terminal and enter:

pip install hessianfree

To make sure things are working, open the python interpreter and enter:

import hessianfree as hf
hf.test.test_xor()

A simple xor training example will run, at the end of which it will display the target and actual outputs from the network.

Developer install

Use this if you want to track the latest changes from the repository:

git clone https://github.com/drasmuss/hessianfree.git
cd hessianfree
python setup.py develop --user

Requirements

  • python 2.7

  • numpy 1.9

  • scipy 0.15

  • optional: matplotlib 1.4, pycuda 2014

(older versions may work, but are untested)

Features

All the standard features of Hessian-free optimization from Martens (2010) and Martens and Sutskever (2011) are implemented (Gauss-Newton approximation, early termination, CG backtracking, Tikhonov damping, structural damping, etc.). In addition, the code has been designed to make it easy to customize the network you want to train, without having to modify the internal computations of the optimization process.

  • Works for feedforward and recurrent deep networks (or mixtures of the two)

  • Standard nonlinearities built in (e.g., logistic, tanh, ReLU, softmax), and support for custom nonlinearities

  • Standard loss functions (squared error, cross entropy), support for custom loss functions and test error functions (e.g., categorization error)

  • Various weight initialization methods (although Hessian-free optimization doesn’t usually require much tweaking)

  • Customizable connectivity between layers (e.g., skip connections)

  • Efficient implementation, taking advantage of things like activity caching

  • Optional GPU acceleration if PyCUDA is installed

  • Gradient checking (and Gauss-Newton matrix checking) implemented to help with debugging

  • Inputs can be predefined or generated dynamically by some other system (like an environmental simulation)

  • Different optimizers can be swapped out for comparison (e.g., Hessian-free versus SGD)

The best way to understand how to use these features is to look through the examples in test.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hessianfree-0.1.5.zip (27.9 kB view details)

Uploaded Source

File details

Details for the file hessianfree-0.1.5.zip.

File metadata

  • Download URL: hessianfree-0.1.5.zip
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hessianfree-0.1.5.zip
Algorithm Hash digest
SHA256 dc9d1fb06b4d830e46d136c1351c1752319bee8c21828c6898c850554ce7160b
MD5 62caf22447185a2eedab00206829d2f1
BLAKE2b-256 2b86c7e6a446c7d7112c8fbde969e4c5a345d7456b59a1cc3bb1b7a4b3539350

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page