Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otTinn Class Reference
[Neural Network - Neural network libraryNeural Network - Neural network library]

Class for neural network.

#include <otNeuralNetwork.h>


Public Member Functions

 otTinn ()
bool init (int nips, int nops, int nhid, otFILE *fs)
void close ()
float * predict (const float *in)
float train (const float *in, const float *tg, float rate)
bool save (const char *path)
bool load (const char *path)
void print (const float *arr, const int size)
void properties (int &nips, int &nops, int &nhid)


Constructor & Destructor Documentation

otTinn.otTinn  ) 
 

Create the class


Member Function Documentation

void otTinn.close  ) 
 

Free all allocated resources

bool otTinn.init int  nips,
int  nops,
int  nhid,
otFILE fs
 

Init neural network

Parameters:
nips Number of inputs to neural network
nops Number of outputs of the neural network
nhid Number of hidden layers of the neural network
fs Pointer to the class for file system access
Returns:
True on init success

bool otTinn.load const char *  path  ) 
 

Loads a otTinn from disk.

Parameters:
path File name and related path of neural network will be loaded
Returns:
True on loading success

float* otTinn.predict const float *  in  ) 
 

Returns an output prediction given an input.

Parameters:
in Input pattern
Returns:
The array of prediction

void otTinn.print const float *  arr,
const int  size
 

Prints an array of floats. Useful for printing predictions.

Parameters:
arr Array to print
size Size of the array to print

void otTinn.properties int &  nips,
int &  nops,
int &  nhid
 

Read properties of the neural network.

Parameters:
nips Number of inputs
nops Number of outputs
nhid Number of hidden layers

bool otTinn.save const char *  path  ) 
 

Saves a otTinn to disk.

Parameters:
path File name and related path where neural network will be saved
Returns:
True on save success

float otTinn.train const float *  in,
const float *  tg,
float  rate
 

Trains a otTinn with an input and target output with a learning rate.

Parameters:
in Training pattern
tg Target pattern
rate Learning rate
Returns:
target to output error.


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0