41 SOM(
const std::string& name=
"SOM",
42 const std::string& revision =
"$Id$");
47 SOM(
unsigned int dimensions,
double sigma,
double eps,
double rbfsize,
48 const std::string& name=
"SOM",
49 const std::string& revision =
"$Id$");
58 virtual void init(
unsigned int inputDim,
unsigned int outputDim,
59 double unit_map = 0.0,
RandGen* randGen = 0);
70 double learnRateFactor = 1);
72 virtual void damp(
double damping) {
return;}
74 virtual unsigned int getInputDim()
const {
return weights[0].getM();}
75 virtual unsigned int getOutputDim()
const {
return weights.size();}
78 virtual bool store(FILE* f)
const;
110 std::vector<matrix::Matrix> weights;
111 std::vector<matrix::Matrix> diffvectors;
Matrix type.
Definition: matrix.h:65
static matrix::Matrix indexToCoord(int index, int size, int dimensions)
converts coordinates to index (size is the size of the space)
Definition: som.cpp:92
virtual ~SOM()
Definition: som.h:50
static double activationfunction(void *rdfsize, double d)
activation function (rbf)
Definition: som.cpp:76
double eps
learning rate for weight update
Definition: som.h:107
SOM(const std::string &name="SOM", const std::string &revision="$Id$")
Definition: som.cpp:31
static bool validCoord(const matrix::Matrix &m, int size)
checks whether the given coordinate is within the lattice
Definition: som.cpp:103
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
virtual bool store(FILE *f) const
stores the object to the given file stream (ASCII preferred).
Definition: som.cpp:188
virtual void damp(double damping)
damps the weights and the biases by multiplying (1-damping)
Definition: som.h:72
virtual const matrix::Matrix process(const matrix::Matrix &input)
passive processing of the input (this function is not constant since a recurrent network for example ...
Definition: som.cpp:159
virtual void init(unsigned int inputDim, unsigned int outputDim, double unit_map=0.0, RandGen *randGen=0)
initialised som
Definition: som.cpp:45
std::list< std::pair< int, double > > Neighbours
Definition: som.h:38
self-organised map class.
Definition: som.h:36
virtual bool restore(FILE *f)
loads the object from the given file stream (ASCII preferred).
Definition: som.cpp:203
void initNeighbourhood(double sigma)
initialised neighbourhood
Definition: som.cpp:113
const Neighbourhood & getNeighbourhood()
Definition: som.h:83
virtual void printWeights(FILE *f) const
Definition: som.cpp:152
std::vector< std::pair< matrix::Matrix, double > > Neighbourhood
Definition: som.h:39
static int coordToIndex(const matrix::Matrix &m, int size)
converts index to coordinates (size is the size of the space)
Definition: som.cpp:82
abstract class (interface) for a model that can be used by a controller
Definition: abstractmodel.h:34
virtual const matrix::Matrix learn(const matrix::Matrix &input, const matrix::Matrix &nom_output, double learnRateFactor=1)
Definition: som.cpp:170
virtual unsigned int getInputDim() const
returns the number of input neurons
Definition: som.h:74
virtual unsigned int getOutputDim() const
returns the number of output neurons
Definition: som.h:75
Neighbours getNeighbours(int winner)
returns neighbourhood as a list of indices with weights
Definition: som.cpp:130