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

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
cd hessianfree
python develop --user


  • 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

Installing PyCUDA on Windows

Steps to install PyCuda on Win7/10 64bit (as of Feb. 2016)

Assumes default installation locations, adjust as appropriate.

  1. Install python, numpy

  2. Install Visual Studio Express 2013 for Desktop (

  3. Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

    • Rename the x86_amd64 folder to amd64
  4. Go into the amd64 folder

    • Rename vcvarsx86_amd64.bat to vcvars64.bat
  5. Add the following to system path:

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;
  6. Install CUDA (

    • ignore warning about not finding visual studio
  7. Go to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin

    • open nvcc.profile
    • change the line starting with INCLUDES to:
    INCLUDES        +=  "-I$(TOP)/include" "-I$(TOP)/include/cudart" "-IC:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/include" $(_SPACE_)
  8. Install PyCUDA