Four Free Neural Network Libraries for Python

Here is an exhaustive list of the 4 free Artificial Neural Network Libraries for use with your Python code. In the coming weeks I’m going to try out a few of them and update this post. I’d love to hear anyone’s experiences with any of these. If you’ve used them please leave us a comment.

Here they are listed in the order of my perception of their overall quality:

1. First we have the Fast Artificial Neural Network Library (FANN). It is written in C but says it has Python bindings. The bindings for Python look hard to set up but on the plus side it looks well maintained and claims to be extremely fast.

2. Next there is the neural network code by Neil Schemenauer. It’s just a lone .py file sitting out in the middle of the internet. What looks good about this is that it’s written in pure Python, and it’s really short. This makes me think it will be easy to understand and verify. It’s also public domain which is nice. I’m also encouraged by the fact that this fancy IBM type article used this module. Perhaps that article will serve as a de facto documentation for the module?

3. The Pyro Python Robotics project seems to have some neural network stuff but on a cursory glance it appears to be more a tutorial than something you can download and use.

4. Finally, NEURObjects is a set of C++ library classes for neural networks development. I only include it here because I always hear that it’s easy to make a Python wrapper for C++ code. Of course I’ve never been able to figure out how myself, but it might work as a last resort. (Python experts, please give us a tutorial on this wrapper stuff!)

I’m surpsised I didn’t find more free Python neural network libraries. If you know of any I’ve left out, please leave a comment. I would especially think that something would have been done with numpy since that would make for a fast running neural network.

And just in case you want to use a neural network but can’t think of a good excuse, here are a couple of good (financial) ideas to get you started.

[tags]ANN, MLP, Artificial Neural Network, Multilayer Perceptron, Backpropagation, weights, Python Neural network, Python Neural networks, neural network, neural networks, machine learning, data mining[/tags]

11 Responses to “Four Free Neural Network Libraries for Python”

  1. gtonic says:


    well I’ve used for my neural networks course, it was a nice intro to get some basic ideas about ann.

    during the course I used the Neurodimensions book( for testing, and started building my own neural network library using .Net, so maybe you’ll also end up building your own lib for python ;)

    Kind regards,

  2. This may be more general than what you had intended, but are you familiar with the classic “Artificial Intelligence: A Modern Approach”? (

    There’s python code available here for much of the book:

  3. Bill Mill says:

    I would also look to see if there’s a c/c++ neural network library that you like. If there is, binding the functions that you are interested in using via Swig, Pyrex, or ctypes is probably on the order of 1-4 days of work.

    Also, if the library you like is in .Net, you can use it via IronPython or Boo, and if it’s in Java, you can use Jython.

  4. Great info guys.

    Tom, why did you build your own, were you not happy with

    Duncan, thanks for pointing out the aima code. I didn’t see any neural network code there but some of that code could be useful for a code project nonetheless.

    Bill, those sound like good options for the c/c++ libaries. I didn’t know Pyrex could expose c++ functions like that, I’ll have to check it out. It certainly seems to be the most approachable of the three.

  5. gtonic says:

    Well first of all I wanted to switch both – the sigmoid function (tanh, logistic, ..) as well as the updating algorithm (lms, delta, backprop). Further, it depends on the application, I needed to reduce the number of connections (for the OLAM). All in all more than just a refactor so it took 2-3 days to do in C#…

  6. Marek says:

    Look at – feedforward neural network for python.

  7. Jason Tudisco says:

    Another Python ann
    Fast Artificial Neural Network Library (FANN)

  8. Look here for the numpy version of bpnn

    There are also some Self-Organized SOFM networks and also an evolutionary trained network

    I think that the very best version should be come from a good wrapper for FANN but this seems to be dificult due to up to date this wrapper is still ugly.

    I will test ffnet also.

  9. Thiago F Pappacena says:

    I have a small toolkit for python neural networks at sourceforge:

    It has MLP (backpropagation and a genetic algorithm test), SOM, ART1 and ART2 implementation. Might have some bugs, and it’s not well documented, but you can see the examples and the source code is quite readeble. :-)

  10. Mason Swanson says:
  11. sunil says:

    hello i am doing a project on bpnn so plz kindly send me a copy of code for bpnn in c++