Introduction

Why another Neural Network library ?

'Why not?' might be a possible answer.

In the beginning of 2005 I was searching for a neural network library easy to use, flexible and easily customized and extensible. After a few months I realized that there wasn't such a library (or at least I didn't find it). Despise the great number of project available on the Internet, there isn't a library developed with following aims:

  1. easy to use and understand;
  2. flexibility in all aspects of neural networks;
  3. extensible in a straightforward and documented;
  4. computationally efficient.
The Neural Network Framework was created with these aims in mind.

[Up]

What is NNFW ?

The NNFW project is a set of C++ classes for creating a wide variety of neural networks. The framework is structured at different levels of complexity, in order to provide various interfaces for quick-easy and deep-expert utilizations:
  1. at the lowest level it's possible to act completely free of restrictions for building complex architectures; from this level expert-users can contribute to NNFW adding new functionalities;
  2. in the intermediate level there are classes for quick-creation of common neural networks such as the multilayer feed-forward network, simple recurrent networks (e.g. Elman, Jordan), Radial-basis network and so on;
  3. the possibility to represent a neural network with XML files, allows for an abstract and general interface for accessing all the functionalities of the NNFW;
  4. a graphical interface it's the high level method to use the framework; this is the most user-friendly and easy method for users, and a way to fool around with complex neural networks.
[Up]

What is NNFW not ?

It's not an application for education purpose. The utilization of this library requires a basic knowledge about neural network and its dynamics. For accessing to all functionalities of NNFW, is required a basic knowledge of C++ and Object-Oriented programming.

Its developed by researchers for research-purpose. [Up]

Download & Installation

Requirements

CMake
In order to compile the library, the CMake tool is required. Download and Install the latest version available from CMake official website.
The Linux users are adviced to install the distribution specific package of CMake even if it is not up-to-date.
Doxygen
In order to generate the API documentation, the Doxygen tool is required. Download and Install the version 1.5.x from Doxygen website.
QT 4.x Library
Starting from version 0.6.x, the QT trolltech library version 4.x is required. You can download it from trolltech website. The opensource edition of QT is free, select your platform, download it and follow the instruction provided by Trolltech to install QT library.

Optional Libraries

GSL
For a more reliable (and truly) randomness of Random class you can download and install the GSL (GNU Scientific Library) version 1.6 (or above). The Linux version is available at the official website. While, the Win32 version is available at the GnuWin32 project. MAC OS X users can download the sources from officile website and compile them from terminal. Alternative, there are two project that provides an easy way to install opensource projects (like GSL): DarwinPorts and Fink.
Intel MKL
Intel MKL (Matrix Kernel Library)

Choose your package

On the NNFW website there are three package available for downloads. Choose them that better fits with your needs:

Configuring the NNFW

In order to configure the different aspect of NNFW, you have to sets the NNFW_CONFIG variable from CMake configuration interface. The CMake configurator is different depending on the platform on wich you run it, see the platform specific instruction for some details about it. The NNFW_CONFIG variable is a string (empty is allowable) can contains the following keys separated by a space: For instance, if NNFW_CONFIG is setted to "mkl double" then the library will be compiled with double precision and linked against Math Kernel Library.

In addition, the standard variable CMAKE_BUILD_TYPE of CMake is also useful to sets how library will be compiled. The possibile options of CMAKE_BUILD_TYPE are Debug, Release, RelWithDebInfo and MinSizeRel. See CMake documentation.

Compiling NNFW on Linux

  1. Download the source package and unpack it where you want;
  2. Open your preferred console and move to the directory where NNFW has been unpacked;
Quick procedure
  1. Launch follow commands:
    $> cmake .
    $> make
    $> make install
  2. The library will be installed in the /usr/local directory
Normal procedure
  1. Launch the program ccmake:
    $> ccmake .
  2. Configure the NNFW_CONFIG variable to fits your needs; (see Configuring the NNFW )
  3. Press the "c" key on the keyboard to check the pre-compiling configuration's parameters (please consider that default parametrs should works correctly);
  4. Press the "g" key on the keyboard to generate the Makefile and return to the Terminal;
  5. Launch the command "make" to compile the library;
  6. A file named "libnnfw.a" will be created in lib directory of source tree;
  7. Now with "make install" the library will be installed in the PREFIX directory configured by ccmake.
Recommended procedure (out-of-sources building)
  1. Suppose that you unpacked sources in directory /some/place/nnfw-src/
  2. Create a subdirectory called build: /some/place/nnfw-src/build
  3. Move to build directory and from there launch ccmake:
    $> ccmake ../
  4. Configure the NNFW_CONFIG variable to fits your needs; (see Configuring the NNFW )
  5. Press the "c" key on the keyboard to check the pre-compiling configuration's parameters (please consider that default parametrs should works correctly);
  6. Press the "g" key on the keyboard to generate the Makefile and return to the Terminal;
  7. Launch the command "make" to compile the library;
  8. A file named "libnnfw.a" will be created in lib directory of build tree;
  9. Note that all stuffs generated by CMake and Make procedures are localized into the build directory; so the main source tree is kept clean!
  10. Now with "make install" the library will be installed in the PREFIX directory configured by ccmake.

Compiling NNFW on Mac OS X

  1. Download the source package and unpack it where you want;
  2. Open the Terminal and move to the directory where NNFW has been unpacked;
  3. Launch the command "ccmake ." (without quotes) to start the CMake's configuration program;
  4. Configure the NNFW_CONFIG variable to fits your needs; (see Configuring the NNFW )
  5. Press the "c" key on the keyboard to check the pre-compiling configuration's parameters (please consider that default parametrs should works correctly);
  6. Press the "g" key on the keyboard to generate the Makefile and return to the Terminal;
  7. Launch the command "make" to compile the library;
  8. A file named "libnnfw.a" will be created in lib directory of source tree;

You can use the libnnfw.a directly from there, but if you want to install it launch the command "make install". It will copies the headers in PREFIX/include directory (note PREFIX is a CMake variable) and the library in PREFIX/lib. The library is now installed. If you want to use it with XCode follow that simple steps:

  1. Start creating a new XCode's project and choosing the "C++ standard tool" template;
  2. According to the Xcode's default setting, in the left section of the program's windows should be present an area called "Group & Files";
  3. Locate the "libnnfw.a" file through the Finder and then, "drag&drop" it inside the "Source" subsection of "Group & Files"; (see screenshot below)
  4. The library is now included in your project;
  5. Now, you have to configure XCode's "User Header Search Path";
  6. Inside the "Group & Files" area, select the project's target and right click them;
  7. From the contextual menu appeared, choose "Get Info" and move to the "Build" tab;
  8. Fill the "User Header Search Path" field with the string PREFIX/include/nnfw

xcode.jpg

XCode screeshot

[Up]

Compiling and Running the tutorials

[Up]

How is organized this manual

[Up]

Notes about compilers and IDE

[Up]
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!