GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Categories
  • Newsletter
  • Submit
  • Login
  • Awesome C++
  • Artificial Intelligence

This view

  • Original page
  • New address

GeezerVison is showing cpp.libhunt.com — Genann Alternatives - C++ Artificial Intelligence | LibHunt

  • Subscribe
  • Submit
  • Categories
  • About
  • Login

Genann

simple neural network library in C99

codeplea logo
codeplea.com    Source Code    Changelog
Suggest Changes
Take the C++ Developer Survey - About 6 minutes on the tools, libraries and AI you use with C++. You get the results by email. Take the survey »
Popularity
6.8
Stable
Activity
6.6
-
Stars 2,302
Watchers 83
Forks 273
Last Commit 4 months ago

Description

Genann is a minimal, well-tested library for training and using feedforward artificial neural networks (ANN) in C. Its primary focus is on being simple, fast, reliable, and hackable. It achieves this by providing only the necessary functions and little extra.

Code Quality Rank: L4
Programming language: C
License: zlib License
Tags: Artificial Intelligence     Machine Learning     Robotics     Scientific Computing     Neural Network     Reinforcement Learning    

Genann alternatives and similar libraries

Based on the "Artificial Intelligence" category.
Alternatively, view Genann alternatives based on common mentions on social networks and blogs.

  • PyTorch

    10.0 10.0 L3 Genann VS PyTorch
    Tensors and Dynamic neural networks in Python with strong GPU acceleration
    pytorch logo
  • TensorFlow

    10.0 10.0 L1 Genann VS TensorFlow
    An Open Source Machine Learning Framework for Everyone
    tensorflow logo
  • SaaSHub - Software Alternatives and Reviews

    SaaSHub helps you find the best software and product alternatives
    Promo www.saashub.com
    SaaSHub Logo
  • CNTK

    9.6 0.0 L1 Genann VS CNTK
    DISCONTINUED. Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
    microsoft logo
  • Eclipse Deeplearning4J

    9.5 5.8 L1 Genann VS Eclipse Deeplearning4J
    Suite of tools for deploying and training deep learning models using the JVM. Highlights include model import for keras, tensorflow, and onnx/pytorch, a modular and tiny c++ library for running math code and a java based math library on top of the core c++ library. Also includes samediff: a pytorch/tensorflow like library for running deep learn...
    deeplearning4j logo
  • Recast/Detour

    8.9 9.4 L1 Genann VS Recast/Detour
    Industry-standard navigation-mesh toolset for games
    recastnavigation logo
  • tiny-cnn

    8.5 0.0 L2 Genann VS tiny-cnn
    header only, dependency-free deep learning framework in C++14
    tiny-dnn logo
  • frugally-deep

    5.7 6.0 Genann VS frugally-deep
    A lightweight header-only library for using Keras (TensorFlow) models in C++.
    Dobiasd logo
  • Veles

    5.4 3.4 L2 Genann VS Veles
    Distributed machine learning platform
    Samsung logo
  • Tulip Indicators

    5.3 5.2 L3 Genann VS Tulip Indicators
    Technical Analysis Indicator Function Library in C
    TulipCharts logo
  • AI-Toolbox

    4.6 2.4 L4 Genann VS AI-Toolbox
    A C++ framework for MDPs and POMDPs with Python bindings
    Svalorzen logo
  • btsk

    4.3 0.0 L5 Genann VS btsk
    Behavior Tree Starter Kit
    aigamedev logo
  • BayesOpt

    4.0 1.1 L1 Genann VS BayesOpt
    BayesOpt: A toolbox for bayesian optimization, experimental design and stochastic bandits.
    rmcantin logo
  • Modern C++ framework for Symbolic Regression

    3.3 9.7 Genann VS Modern C++ framework for Symbolic Regression
    Modern C++ framework for symbolic regression that uses genetic programming to explore a hypothesis space of possible mathematical expression.
    heal-research logo
  • Native System Automation

    3.3 0.0 L1 Genann VS Native System Automation
    Native cross-platform system automation
    Robot logo
  • ANNetGPGPU

    2.7 0.0 L2 Genann VS ANNetGPGPU
    A GPU (CUDA) based Artificial Neural Network library
    ANNetGPGPU logo
  • Tulip Cell

    2.0 0.0 Genann VS Tulip Cell
    TulipCell is an Excel add-in providing 100+ technical analysis indicators.
    TulipCharts logo
  • openmind

    1.7 9.7 Genann VS openmind
    Deduction framework with arbitrary mathematical system solver.
    ohhmm logo
  • nano

    1.6 8.4 Genann VS nano
    DISCONTINUED. C++ library [machine learning & numerical optimization]
  • Evolving Objects

    - Genann VS Evolving Objects
    A template-based, ANSI-C++ evolutionary computation library which helps you to write your own stochastic optimization algorithms insanely fast. [LGPL]

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.

Do you think we are missing an alternative of Genann or a related project?

Add another 'Artificial Intelligence' Library

Popular Comparisons

  • Genann
    vs
    tiny-cnn
  • Genann
    vs
    TensorFlow
  • Genann
    vs
    Recast/Detour
  • Genann
    vs
    Tulip Indicators
  • Genann
    vs
    BayesOpt

README

Build Status

Genann

Genann is a minimal, well-tested library for training and using feedforward artificial neural networks (ANN) in C. Its primary focus is on being simple, fast, reliable, and hackable. It achieves this by providing only the necessary functions and little extra.

Features

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

Building

Genann is self-contained in two files: genann.c and genann.h. To use Genann, simply add those two files to your project.

Example Code

Four example programs are included with the source code.

  • [example1.c](./example1.c) - Trains an ANN on the XOR function using backpropagation.
  • [example2.c](./example2.c) - Trains an ANN on the XOR function using random search.
  • [example3.c](./example3.c) - Loads and runs an ANN from a file.
  • [example4.c](./example4.c) - Trains an ANN on the IRIS data-set using backpropagation.

Quick Example

We create an ANN taking 2 inputs, having 1 layer of 3 hidden neurons, and providing 2 outputs. It has the following structure:

[NN Example Structure](./doc/e1.png)

We then train it on a set of labeled data using backpropagation and ask it to predict on a test data point:

#include "genann.h"

/* Not shown, loading your training and test data. */
double **training_data_input, **training_data_output, **test_data_input;

/* New network with 2 inputs,
 * 1 hidden layer of 3 neurons each,
 * and 2 outputs. */
genann *ann = genann_init(2, 1, 3, 2);

/* Learn on the training set. */
for (i = 0; i < 300; ++i) {
    for (j = 0; j < 100; ++j)
        genann_train(ann, training_data_input[j], training_data_output[j], 0.1);
}

/* Run the network and see what it predicts. */
double const *prediction = genann_run(ann, test_data_input[0]);
printf("Output for the first test data point is: %f, %f\n", prediction[0], prediction[1]);

genann_free(ann);

This example is to show API usage, it is not showing good machine learning techniques. In a real application you would likely want to learn on the test data in a random order. You would also want to monitor the learning to prevent over-fitting.

Usage

Creating and Freeing ANNs

genann *genann_init(int inputs, int hidden_layers, int hidden, int outputs);
genann *genann_copy(genann const *ann);
void genann_free(genann *ann);

Creating a new ANN is done with the genann_init() function. Its arguments are the number of inputs, the number of hidden layers, the number of neurons in each hidden layer, and the number of outputs. It returns a genann struct pointer.

Calling genann_copy() will create a deep-copy of an existing genann struct.

Call genann_free() when you're finished with an ANN returned by genann_init().

Training ANNs

void genann_train(genann const *ann, double const *inputs,
        double const *desired_outputs, double learning_rate);

genann_train() will preform one update using standard backpropogation. It should be called by passing in an array of inputs, an array of expected outputs, and a learning rate. See example1.c for an example of learning with backpropogation.

A primary design goal of Genann was to store all the network weights in one contigious block of memory. This makes it easy and efficient to train the network weights using direct-search numeric optimization algorthims, such as Hill Climbing, the Genetic Algorithm, Simulated Annealing, etc. These methods can be used by searching on the ANN's weights directly. Every genann struct contains the members int total_weights; and double *weight;. *weight points to an array of total_weights size which contains all weights used by the ANN. See example2.c for an example of training using random hill climbing search.

Saving and Loading ANNs

genann *genann_read(FILE *in);
void genann_write(genann const *ann, FILE *out);

Genann provides the genann_read() and genann_write() functions for loading or saving an ANN in a text-based format.

Evaluating

double const *genann_run(genann const *ann, double const *inputs);

Call genann_run() on a trained ANN to run a feed-forward pass on a given set of inputs. genann_run() will provide a pointer to the array of predicted outputs (of ann->outputs length).

Hints

  • All functions start with genann_.
  • The code is simple. Dig in and change things.

Extra Resources

The comp.ai.neural-nets FAQ is an excellent resource for an introduction to artificial neural networks.

If you need an even smaller neural network library, check out the excellent single-hidden-layer library tinn.

If you're looking for a heavier, more opinionated neural network library in C, I recommend the FANN library. Another good library is Peter van Rossum's Lightweight Neural Network, which despite its name, is heavier and has more features than Genann.


*Note that all licence references and agreements mentioned in the Genann README section above are relevant to that project's source code only.

Do not miss the trending, libraries, news and articles with our weekly report.

Awesome C++ is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
Spin The Wheel Of Names for a cryptographically secure random name picker.
Schedule a when to meet poll.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.