The Professional and Developers versions of NeuroSolutions have the ability to generate ANSI-compatible C++ source code for any network, including learning. This allows a simulation prototyped within the GUI to be run on other hardware platforms. In addition, NeuroSolutions' networks can be integrated into your own applications.
NeuroSolutions can automatically generate an ANSI-compatible C++ program from any simulation constructed by the graphical user interface (GUI). This program is ready to be compiled, linked against NeuroSolutions' libraries, and run without requiring the user to write a single line of code.
// Example.cpp
// Automatically generated from breadboard by NeuroSolutions.
#include "NS.h"
void main() {
This is possible because of NeuroSolutions' object-oriented design. All simulations are implemented by neural objects, which have been written in ANSI-compatible C++. To run a simulation, the GUI instantiates and interconnects these objects in memory. To generate source code, NeuroSolutions simply writes out the same sequence of steps into an ASCII text file, wrapping them into a main program.
Axon axon1;
File in15;
FullSynapse synapse2;
Momentum gradient24;
TanhAxon axon3;
File out19;
Any parameter specified by the user in a component's inspector will be used to initialize the component in the program. In addition, all input and output components on the breadboard will translate their data into an ASCII, binary or standard IO file format, unless the user has chosen to handle the IO within the main program itself.
axon1.setRows(100);
in15.setFilePath("in15.bin");
in15.setMode(READ,BINARY);
gradient24.setDefaultStepSize((NSFloat)0.001000);
axon3.setRows(10);
out19.setMode(WRITE,STANDARD);
Once initialized, components are interconnected to create a network topology identical to that constructed on the breadboard.
axon1.setPreActivityAccess(&in15);
axon1.setNext(&synapse2);
synapse2.setLast(&axon1);
synapse2.setNext(&axon3);
axon3.setLast(&synapse2);
axon3.setActivityAccess(&out19);
Finally, the simulation is run as specified by the network controllers. Notice that source code can be generated either with or without learning.
int reportCounter, updateCounter=0;
for (unsigned int epoch=0, exemplar; epoch 1000; epoch++) {
for (exemplar=0; exemplar 100; exemplar++) {
axon1.fire();
backpropStarting();
axon3.fire();
backpropComplete();
if (++updateCounter >= 100) {
gradient24.update(&synapse2);
updateCounter = 0;
}
}
}
}
NeuroSolutions Home Page