Skip to main content
Travis-CI build status AppVeyor build status Latest PyPI version Number of PyPI downloads

Hessian-free optimization for deep networks

Setup

Quick start

Install the package via:

pip install hessianfree

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

import hessianfree as hf
hf.demos.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 or 3.5

  • numpy 1.9.2

  • matplotlib 1.3.1

  • optional: scipy 0.15.1, pycuda 2015.1.3, scikit-cuda 0.5.1, pytest 2.7.0

(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, sparsity constraints), and support for custom loss functions

  • 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 and scikit-cuda are 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)

Documentation

View the documentation at http://pythonhosted.org/hessianfree/

In addition, examples illustrating the main features of the code can be found in demos.py.

Metadata

Release files for hessianfree 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hessianfree 0.4.0
File Size Uploaded Provenance Actions
hessianfree-0.4.0.zip 64.3 kB Without provenance Details for hessianfree-0.4.0.zip

Release files / hessianfree-0.4.0.zip

Download URL hessianfree-0.4.0.zip
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
faacb0906e38fd2e878d0bc2c68167fca6b24319c0283be99c7643a42a6b694b
BLAKE2b-256 checksum
How to use checksums
f7b3e1e31f20d363abe6c3882920392d83ad85cec1bbac64d3223ef2ef8f9bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for hessianfree 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page