Lightweight Neural Network++ documentation

Visit the lwnnplus home page, download the technical report in english or italian.

Main Page | Class Hierarchy | Class List | File List | Class Members

iomanagelwnnfann Class Reference

This class manages files in lwnn format and fann format. More...

#include <iomanagelwnnfann.h>

Inheritance diagram for iomanagelwnnfann:

iomanage List of all members.

Public Member Functions

 iomanagelwnnfann ()
 Constructor Does nothing, of course, because the class has no fields!
virtual void info_from_file (const string &filename, int *npatterns, int *ninput, int *noutput)
 Read info from file.
virtual void load_patterns (const string &filename, float **inputs, float **targets, int ninput, int noutput, int npatterns)
 Read info from file.

Static Public Member Functions

void info_from_file_lwnn (const string &filename, int *npatterns, int *ninput, int *noutput)
 Read info from file.
void info_from_file_fann (const string &filename, int *npatterns, int *ninput, int *noutput)
 Read patterns from file.
void load_patterns_lwnn (const string &filename, float **inputs, float **targets, int ninput, int noutput, int npatterns)
 Read info from file.
void load_patterns_fann (const string &filename, float **inputs, float **targets, int ninput, int noutput, int npatterns)
 Read info from file.

Detailed Description

This class manages files in lwnn format and fann format.

It is derived by iomanage and implemets reading in two textual formats.

FORMAT OF INPUT FILES

The class guesses the format of the file and reads properly a file without having to know its type.


Member Function Documentation

virtual void iomanagelwnnfann::info_from_file const string &  filename,
int *  npatterns,
int *  ninput,
int *  noutput
[virtual]
 

Read info from file.

Parameters:
filename the name of a file of input/output pairs
npatterns Pointer to a int where is returned the number of pairs in the file
ninput Pointer to a int where is returned the number of inputs
noutput Pointer to a int where is returned the number of outputs
Can throw a runtime_error exception if file does not exist.

Works with both formats and guesses the right format by itself

Implements iomanage.

void iomanagelwnnfann::info_from_file_lwnn const string &  filename,
int *  npatterns,
int *  ninput,
int *  noutput
[static]
 

Read info from file.

Parameters:
filename the name of a file of input/output pairs
npatterns Pointer to a int where is returned the number of pairs in the file
ninput Pointer to a int where is returned the number of inputs
noutput Pointer to a int where is returned the number of outputs
Can throw a runtime_error exception if file does not exist.

Works only with lwnn format

void iomanagelwnnfann::info_from_file_fann const string &  filename,
int *  npatterns,
int *  ninput,
int *  noutput
[static]
 

Read patterns from file.

Parameters:
filename the name of a file of input/output pairs
npatterns Pointer to a int where is returned the number of pairs in the file
ninput Pointer to a int where is returned the number of inputs
noutput Pointer to a int where is returned the number of outputs
Can throw a runtime_error exception if file does not exist.

Works only with fann format

virtual void iomanagelwnnfann::load_patterns const string &  filename,
float **  inputs,
float **  targets,
int  ninput,
int  noutput,
int  npatterns
[virtual]
 

Read info from file.

Parameters:
filename the name of a file of input/output pairs
inputs Read the inputs in this matrix
targets Reat the targets in this matrix
ninput Number of inputs wanted.
noutput Number of outputs wanted
npatterns Number of patterns wanted
Precondition: memory in inputs and outputs has been allocated for npatterns with ninput and noutput vectors. (First index is the index of pattern, second index is the index of neuron)

If the number of inputs or outputs of the patterns or the number of patterns in the file is not equal to ninput and noutput and npatterns throws a runtime_error. Can throw a runtime_error exception if the format of the file isn't right.

Works with both formats and guesses the right format by itself

Implements iomanage.

void iomanagelwnnfann::load_patterns_lwnn const string &  filename,
float **  inputs,
float **  targets,
int  ninput,
int  noutput,
int  npatterns
[static]
 

Read info from file.

Parameters:
filename the name of a file of input/output pairs
inputs Read the inputs in this matrix
targets Reat the targets in this matrix
ninput Number of inputs wanted.
noutput Number of outputs wanted
npatterns Number of patterns wanted
Precondition: memory in inputs and outputs has been allocated for npatterns with ninput and noutput vectors. (First index is the index of pattern, second index is the index of neuron)

Works only with lwnn format

void iomanagelwnnfann::load_patterns_fann const string &  filename,
float **  inputs,
float **  targets,
int  ninput,
int  noutput,
int  npatterns
[static]
 

Read info from file.

Parameters:
filename the name of a file of input/output pairs
inputs Read the inputs in this matrix
targets Reat the targets in this matrix
ninput Number of inputs wanted.
noutput Number of outputs wanted
npatterns Number of patterns wanted
Precondition: memory in inputs and outputs has been allocated for npatterns with ninput and noutput vectors. (First index is the index of pattern, second index is the index of neuron)

If the number of inputs or outputs of the patterns in the file is not equal to ninput and noutput throws a runtime_error. Can throw a runtime_error exception if the format of the file isn't right.

Works only with fann format


The documentation for this class was generated from the following file:
Generated on Tue Oct 12 00:32:12 2004 for Lightweight Neural Network ++ by  doxygen 1.3.9