aimsalgo  5.0.5
Neuroimaging image processing
AimsSelfOrganizingMap Class Reference

The class for Kohonen's self organizing maps. More...

#include <aims/neuralnet/selforganizingmap.h>

Collaboration diagram for AimsSelfOrganizingMap:

Public Member Functions

Constructors and Destructor
 AimsSelfOrganizingMap (int size, int ninputs, float learningrate)
 Constructor for virgin SOM. More...
 
 AimsSelfOrganizingMap (const AimsData< float > &weight, float learningrate)
 Constructor for learned SOM. More...
 
virtual ~AimsSelfOrganizingMap ()
 Destructor deletes the weight data. More...
 

Protected Attributes

Data
int _size
 Size of the square grid. More...
 
int _nInputs
 Number of inputs. More...
 
int _counter
 Number of iterations. More...
 
float _learningRate
 Learning rate. More...
 
AimsData< float > * _weight
 Weights data. More...
 

Methods

AimsVector< short, 2 > winner (const AimsData< float > &input)
 Get the winner neuron for a given input. More...
 
void update (const AimsData< float > &input, float learn, int delta)
 Do a learning step. More...
 
int size () const
 Return the size of the network. More...
 
int nInputs () const
 Return the number of inputs of the network on each neuron. More...
 
int counter () const
 Return the number of epochs during the learning step. More...
 
float learningRate () const
 Return the learning rate of the network. More...
 
void setLearningRate (float learningrate)
 Set the learning rate of the network. More...
 
void learn (const AimsData< float > &base, int counter)
 Send a learning step from a data base. More...
 
AimsData< AimsVector< short, 2 > > test (const AimsData< float > &base)
 Test a data base and return the result. More...
 
void save (const std::string &filename)
 Save all the weights in a GIS file. More...
 

Detailed Description

The class for Kohonen's self organizing maps.

Definition at line 46 of file selforganizingmap.h.

Constructor & Destructor Documentation

◆ AimsSelfOrganizingMap() [1/2]

AimsSelfOrganizingMap::AimsSelfOrganizingMap ( int  size,
int  ninputs,
float  learningrate 
)

Constructor for virgin SOM.

Parameters
sizesize of the square grid of neurons
ninputsnumber of inputs on each neuron
learningratelearning rate

◆ AimsSelfOrganizingMap() [2/2]

AimsSelfOrganizingMap::AimsSelfOrganizingMap ( const AimsData< float > &  weight,
float  learningrate 
)

Constructor for learned SOM.

Parameters
weightweight data for all the neurons
learningratelearning rate

◆ ~AimsSelfOrganizingMap()

virtual AimsSelfOrganizingMap::~AimsSelfOrganizingMap ( )
virtual

Destructor deletes the weight data.

Member Function Documentation

◆ counter()

int AimsSelfOrganizingMap::counter ( ) const

Return the number of epochs during the learning step.

◆ learn()

void AimsSelfOrganizingMap::learn ( const AimsData< float > &  base,
int  counter 
)

Send a learning step from a data base.

Parameters
basethe base is a 2D-data where the x coordinate corresponds to the index of the example and the y coordinate corresponds to the input of the neuron
counternumber of epoch to iterate the process

◆ learningRate()

float AimsSelfOrganizingMap::learningRate ( ) const

Return the learning rate of the network.

◆ nInputs()

int AimsSelfOrganizingMap::nInputs ( ) const

Return the number of inputs of the network on each neuron.

◆ save()

void AimsSelfOrganizingMap::save ( const std::string &  filename)

Save all the weights in a GIS file.

◆ setLearningRate()

void AimsSelfOrganizingMap::setLearningRate ( float  learningrate)

Set the learning rate of the network.

◆ size()

int AimsSelfOrganizingMap::size ( ) const

Return the size of the network.

◆ test()

AimsData< AimsVector<short,2> > AimsSelfOrganizingMap::test ( const AimsData< float > &  base)

Test a data base and return the result.

Parameters
basethe base is a 2D-data where the x coordinate corresponds to the index of the example and the y coordinate corresponds to the input of the neuron
Returns
a 2D-data containing the winner in the grid for each example of the base

◆ update()

void AimsSelfOrganizingMap::update ( const AimsData< float > &  input,
float  learn,
int  delta 
)
protected

Do a learning step.

Parameters
inputinput example
learnlearning rate
deltawidth of the square neighborhood of neurons to update around the winner

◆ winner()

AimsVector<short,2> AimsSelfOrganizingMap::winner ( const AimsData< float > &  input)
protected

Get the winner neuron for a given input.

Member Data Documentation

◆ _counter

int AimsSelfOrganizingMap::_counter
protected

Number of iterations.

Definition at line 55 of file selforganizingmap.h.

◆ _learningRate

float AimsSelfOrganizingMap::_learningRate
protected

Learning rate.

Definition at line 57 of file selforganizingmap.h.

◆ _nInputs

int AimsSelfOrganizingMap::_nInputs
protected

Number of inputs.

Definition at line 53 of file selforganizingmap.h.

◆ _size

int AimsSelfOrganizingMap::_size
protected

Size of the square grid.

Definition at line 51 of file selforganizingmap.h.

◆ _weight

AimsData<float>* AimsSelfOrganizingMap::_weight
protected

Weights data.

Definition at line 59 of file selforganizingmap.h.


The documentation for this class was generated from the following file: