CLAP : C++ Learning and Algebra


A collection of tools for machine learning written in C++ (BSD License). Includes plain old Back-propagation, RBMs, Contrastive Divergence, and more.

Installation instructions

Download the package and change to the clap directory.

You can then

  • Configure the package $ ./configure --enable-openmp --with-gtk . Available options can be reviewed with $ ./configure --help (although the package can be compiled with OpenMP for compatibility with other libraries, the library doesn’t actually use OpenMP. GTK is optional and is mostly used for providing graphical representations when possible, as e.g. in the test programs.)
  • compile the clap library $ make
  • (optional) compile the tests $ make tests
  • (optional) run automated tests $ make check
  • (optional and untested) install the library in your distribution $ make install


At this point, it is assumed that you have a working clap package.

the clap package is provided with a number of testing programs available in the “test/” directory. It can be useful to study these programs to get a better understanding of the library’s functionalities.

The examples below are not meant to be compiled, but only to give an overview of package use. As such they may contain some errors. If you wish to compile these examples, you should look at the corresponding tests files in the “test/” directory. Although those files may be less readable, they should compile and run as expected.


In order to use the module, you just need to include the header files as needed and access the clap namespace as in e.g.:



See the file “test/” for a more comprehensive example.

Deep Neural Net