CSIM: Algorithm Class Reference
Algorithm Class Reference #include <algorithm.h >
Inheritance diagram for Algorithm:
List of all members. Detailed Description
The current algorithm interface is designed for offline-training only, i.e. all learning must occur externally. The algorithm object only "learns" through imported parameter vectors.
Public Member Functions
Public Attributes
double range_low
Lower bound of algorithms range.
double range_high
Upper bound of algorithms range.
Protected Attributes
map< string, double * > params
A map storing pointers to the parameters.
int nInputRows
Number of rows for input vectors.
double dInputRows
Dummy for parameter setting.
Constructor & Destructor Documentation
Algorithm::Algorithm
(
unsigned int
in_rows = 1
,
double
lower_bound = 0
,
double
upper_bound = 1
)
Constructs a new learning algorithm.
Parameters:
in_rows Number of rows in each input vector.
lower_bound Lower bound of the algorithms range.
upper_bound Upper bound of the algorithms range.
Member Function Documentation
virtual int Algorithm::apply
(
const double *
S ,
double *
X
)
[pure virtual]
Applies the currently learned function to the filtered and preprocessed input vector.
Parameters:
S State of the liquid (= filtered and preprocessed response of the neural microcircuit).
X Target pointer where to save the result.
Returns: -1 if an error occured, 1 for success.
Implemented in linear_classification , and linear_regression .
virtual double* Algorithm::exportRepresentation
(
int *
rep_length
)
[pure virtual]
Exports the representation of this algorithm for use in external objects.
Parameters:
rep_length Length of the representation vector.
Returns: A list of parameters that represent the algorithm.
Warning: Do not forget to free the memory reserved for the representation!
Implemented in linear_classification , and linear_regression .
virtual string Algorithm::getFormatDescription
(
)
[pure virtual]
int Algorithm::getInputRows
(
)
[inline]
Returns the number of input rows.
double Algorithm::getParameter
(
string
name
)
[virtual]
Returns the current value of a parameter.
Parameters:
name Name of the parameter.
Returns: The value of the parameter.
void Algorithm::getRange
(
double *
a ,
double *
b
)
Returns the range of the algorithm's target values [a, b].
Parameters:
a Address of lower bound for algorithm's target values.
b Address of upper bound for algorithm's target values.
virtual int Algorithm::importRepresentation
(
const double *
rep ,
int
rep_length
)
[pure virtual]
Imports the data from an externally (e.g. Matlab) trained algorithm.
Parameters:
rep Representation of the algorithm as a double vector.
rep_length Length of the representation vector.
Returns: -1 if an error occured, 1 for success.
Implemented in linear_classification , and linear_regression .
virtual void Algorithm::reset
(
void
)
[inline, virtual]
void Algorithm::setParameter
(
string
name ,
double
value
)
[virtual]
Sets a parameter of the algorithm.
Parameters:
name Name of the parameter.
value Value to set for the parameter.
void Algorithm::setRange
(
double
a ,
double
b
)
Sets the range of the algorithm's target values [a, b].
Parameters:
a Lower bound for algorithm's target values.
b Upper bound for algorithm's target values.
int Algorithm::updateInternal
(
)
[virtual]
This function is called after parameters are updated.
Reimplemented from csimClass .
list< string > Algorithm::validParameters
(
void
)
[virtual]
Returns the names of the valid parameters.
Returns: A string list indicating the valid parameter names.