codeplea/genann logo

codeplea/genann

Free

simple neural network library in ANSI C

FreeFree tier
Type
Open Source

About codeplea/genann

Genann is a minimal, well-tested library for training and using feedforward artificial neural networks (ANN) in C. It focuses on simplicity, speed, reliability, and hackability, providing only essential functions with little extra. The library is self-contained in a single C source file and header (genann.c and genann.h), has no dependencies beyond C99, and is released under the permissive zlib license. It implements standard backpropagation training but is compatible with alternative training methods (e.g., random search, genetic algorithms). The package includes four example programs demonstrating XOR training, random search, loading/saving networks, and the IRIS dataset, as well as a test suite. Genann is thread-safe and easily extendible, making it suitable for embedded systems or educational use.

Key Features

C99 with no dependencies
Contained in a single source code and header file
Simple and easy to understand
Fast and thread-safe
Easily extendible
Implements backpropagation training
Compatible with alternative training methods (random search, genetic algorithms, etc.)
Includes examples and test suite
Released under the zlib license (free for nearly any use)

Pros & Cons

Pros
  • Minimal and well-tested library with no external dependencies
  • Single-file integration (just add genann.c and genann.h)
  • Thread-safe and fast execution
  • Permissive zlib license allows free use in nearly any project
  • Includes practical examples and a test suite
  • Easily hackable and extendible for custom training algorithms
Cons
  • Limited to feedforward neural networks (no recurrent or convolutional support)
  • Only standard backpropagation built-in; advanced features like momentum or regularization not included
  • No GPU acceleration or support for deep learning with many layers
  • Minimal documentation beyond the README and code comments

Best For

Training an ANN on the XOR function using backpropagationTraining an ANN on the XOR function using random searchLoading and running an ANN from a fileTraining an ANN on the IRIS dataset using backpropagationEducational purposes for understanding feedforward neural networksEmbedded systems requiring a lightweight neural network library