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

otNeuralFramework Class Reference
[Neural Network - Neural network library, Neural Network - Neural network library, Neural Network - Neural network library]

Dataset and training support for otTinn. More...

#include <otNeuralNetwork.h>


Public Member Functions

 otNeuralFramework ()
 Create an empty framework object. Call init() before use.
void init (otTinn *tinn, otFILE *fs=0)
 Initialize the framework around an existing network.
void close ()
 Free the loaded dataset and reset the framework state.
bool dataset (const char *path)
 Load a dataset for neural-network learning.
void shuffle ()
 Randomly shuffle dataset rows using Fisher-Yates by default.
float training (float rate)
 Perform one training epoch using the network passed to init().
float training (otTinn &tinn, float rate)
 Perform one training epoch using an explicitly supplied network.
float error () const
 Return the most recent accumulated epoch error.
int rows () const
 Return the number of loaded dataset rows.
int inputs () const
 Return the number of input values per row.
int outputs () const
 Return the number of target/output values per row.
const float * input (int row=0) const
 Return one input row from the loaded dataset.
const float * target (int row=0) const
 Return one target row from the loaded dataset.
bool valid () const
 Return true when a non-empty dataset is currently loaded.


Detailed Description

The framework loads a whitespace-separated dataset, keeps input and target matrices, shuffles rows and performs one complete training epoch.


Constructor & Destructor Documentation

otNeuralFramework.otNeuralFramework (   ) 
 


Member Function Documentation

void otNeuralFramework.close (   ) 
 

bool otNeuralFramework.dataset (  const char *  path  ) 
 

Parameters:
path Dataset filename/path.
Returns:
true on successful loading and parsing.

float otNeuralFramework.error (   )  const
 

void otNeuralFramework.init (  otTinn *  tinn,
otFILE *  fs = 0
) 
 

Parameters:
tinn Neural-network instance to train.
fs Pointer to otStudio filesystem object; required by dataset I/O.

const float* otNeuralFramework.input (  int  row = 0  )  const
 

Parameters:
row Row index in [0, rows()).
Returns:
Pointer to the row, or null if the index/state is invalid.

int otNeuralFramework.inputs (   )  const
 

int otNeuralFramework.outputs (   )  const
 

int otNeuralFramework.rows (   )  const
 

void otNeuralFramework.shuffle (   ) 
 

const float* otNeuralFramework.target (  int  row = 0  )  const
 

Parameters:
row Row index in [0, rows()).
Returns:
Pointer to the row, or null if the index/state is invalid.

float otNeuralFramework.training (  otTinn &  tinn,
float  rate
) 
 

Parameters:
tinn Network to train.
rate Learning rate.
Returns:
Accumulated epoch error, or a negative value on invalid state.

float otNeuralFramework.training (  float  rate  ) 
 

Parameters:
rate Learning rate.
Returns:
Accumulated epoch error, or a negative value on invalid state.

bool otNeuralFramework.valid (   )  const
 


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