The Fast Artificial Neural Network Library (FANN) is a neural network library, which implements multilayer artificial neural networks in C with support for both fully connected and sparsely connected networks. It has a Python binding that allows you to use its functionality from within Python, but with the bits that need speed implemented in C.
We are going to install the FANN library on Ubuntu and install the Python binding. Get and unzip the library:
wget http://downloads.sourceforge.net/project/fann/fann/2.1.0beta/fann-2.1.0beta.zip sudo apt-get install unzip unzip fann-2.1.0beta.zip
Configure, make and install the library:
cd fann-2.1.0/ sudo apt-get install gcc make ./configure make sudo make install
Install the Python bindings:
cd python/ sudo apt-get install g++ python-dev swig sudo python setup.py install
The Python files are now located in a build directory. Copy them to a place where you can use them, e.g. your home directory:
cd build/lib.linux-i686-2.6/pyfann/ cp libfann.py ~ cp _libfann.so ~
And finally test that Python can now work with the library, start up Python and type:
import libfann print dir(libfann)
This should print out all the functions of the library.