OpenNN has been written in ANSI C++. As a consequence, you can build the library on any system with little effort. OpenNN includes project files for Qt Creator. If you want to work with another compiler, you need to create a project for it. In this tutorial, you’ll learn how to do that.Contents:

Visual Studio

To use OpenNN with Visual Studio, you must create a solution for it. This is quickly done using Cmake. First of all, you can download OpenNN from GitHub or Sourceforge. Then, open a terminal, go to your OpenNN folder, and run the following command.

 cmake .

The necessary files for a Visual Studio solution will be created in the directory.

Please mind the following dependencies:

    • The folder opennn contains the OpenNN source library.
    • The folder eigen contains the Eigen template library, which is used by OpenNN.
    • The folder examples contain several applications where OpenNN is used.
    • The folder tests contain other applications where OpenNN is used.

Execute the file opennn.sln and build opennn first, selecting Release as the build type.


Selecting the opennn file.
Building opennn.

You can now run the example applications. Each are located in its respective folder and the .exe file in a Release directory.

Building the iris plant example.

An MS-DOS console should appear with the results of the corresponding example.

Iris plant example results.

Once you have seen OpenNN work, you can develop your neural network application. To do that, use a blank example.

Blank project.

Qt Creator

Qt Creator is a cross-platform IDE (integrated development environment). That means that you can use Qt Creator in Windows, Linux, and macOS. Note that OpenNN does not use the Qt library. To run OpenNN with Qt creator, follow the next steps:

  1. Download Qt.
  2. Run an example.
  3. Create your application.

1. Download Qt

The first step is to download Qt. It can be done from here.

2. Run an example

The project file for Qt Creator can be found in the opennn folder. To start the OpenNN project, double-click on that file.

Many example subprojects are also included in the OpenNN distribution. From the opennn project, select some examples, for instance, the simple_classification subproject. Then run that example by clicking on the play button or pressing Ctrl+R. Read the application code to see what the simple classification example does. The next figure shows the iris plant example.

Iris plant example OpenNN.Iris plant example.

3. Create your application

You can create a new project in a blank example to use the tasks of OpenNN that better suit your needs.

Blank Project.Blank project.