Aquila  2.0 prealpha
Cognitive Robotics Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Slots | Protected Member Functions | List of all members
SOM Class Reference

#include <som.h>

Inheritance diagram for SOM:
GUI

Public Member Functions

 SOM (MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1)
 Constructor.
 
 ~SOM ()
 Destructor.
 
 SOM (Interface *pInterface)
 Constructor.
 
vector< string > queryGPU ()
 Returns detected GPU devices as a list of their names.
 
void loadTrainingSet (Bottle portData=0)
 Loads training data.
 
void randomiseWeights ()
 Randomises self-organising map's weights.
 
void saveMap ()
 Saves trained self-organising map.
 
void printOptions ()
 Prints options.
 
void printGPUProperties (int deviceID)
 Prints properties of a given GPU devices.
 
void setGPUMode (bool gpuMode)
 Sets GPU mode.
 
void setDebugMessages (int level)
 Sets debug message mode.
 
void setDevice (int device)
 Sets current GPU device.
 
void setSeed (int value)
 Sets seed for random number generation.
 
void setMaxThreads (int threads)
 Sets maximum number of threads per blocks.
 
void setNumInputs (int inputs)
 Sets the number of inputs of self-organising map.
 
void setNumSamples (int samples)
 Sets the total number of samples present in the training data.
 
void setNumOutputs (int outputs)
 Sets the number of outputs of self-organising map.
 
void setNumSubiterations (int subIterations)
 Sets the number of sub-iterations used during the training.
 
void setInitLearningRate (float learningRate)
 Sets the initial learning rate used during the training.
 
void setSigma (float sigma)
 Sets the sigma value used during the training.
 
void setVisualiseProgress (bool visualise)
 Sets the progress visualisation on/off.
 
void setIterationPause (int value)
 Sets the iteration pause.
 
void setNeighbourhoodSize (int value)
 Sets self-organising map's neighbourhood size.
 
void setNumIterations (int value)
 Sets the number of iterations used during the training.
 
void setTrainingFile (string fileName)
 Sets the file name containing the training data.
 
void setMapFile (string fileName)
 Sets the file name used for saving the trained self-organising map.
 
void getWeightsAsBottle (Bottle *bottle)
 Loads the bottle with self-organising map's weigths.
 
int getDevice ()
 Returns current GPU device.
 
int getDebugMessages ()
 Returns current debug message level.
 
int getSeed ()
 Returns current seed.
 
int getMaxThreads ()
 Returns current maximum number of threads per block.
 
int getNumInputs ()
 Returns current number of inputs.
 
int getNumSamples ()
 Returns current number of samples.
 
int getNumOutputs ()
 Returns current number of outputs.
 
int getNeighbourhoodSize ()
 Returns current neighbourhood size.
 
int getNumSubiterations ()
 Returns current number of sub-iterations.
 
int getIterationPause ()
 Returns current iteration pause value.
 
float getInitLearningRate ()
 Returns current initial learning rate.
 
float getSigma ()
 Returns current sigma.
 
float getTrainingTime ()
 Returns the time it took to train the slef-organising map.
 
float getLowestDataPoint ()
 Returns the lowest data point found in the training data file.
 
float getHighestDataPoint ()
 Returns the highest data point found in the training data file.
 
bool getVisualiseProgress ()
 Returns current progress visualisation mode.
 
string getTrainingFile ()
 Returns the trianing file name.
 
string getMapFile ()
 Returns the file name used for saving the trained self-organising map.
 
- Public Member Functions inherited from GUI
 GUI (MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1)
 Constructor.
 
 ~GUI ()
 Destructor.
 

Protected Slots

void about ()
 Shows message box with the information about module.
 
void updateGUI ()
 Updates graphical user interface.
 
- Protected Slots inherited from GUI
virtual void about ()
 Shows message box with the information about module.
 
virtual void show ()
 Shows menu.
 
virtual void checkFocus (int tabID)
 Checks if the module tab is currently selected.
 
virtual void statusChanged (int newStatus)
 Updates module based on the new status.
 
virtual void createMenu ()
 Creates menu.
 
virtual void createEditMenu ()
 Creates edit menu.
 
virtual void createHelpMenu ()
 Creates help menu.
 
virtual void createModuleMenu ()
 Creates module menu.
 
virtual void createDeviceSubmenu ()
 Creates device sub-menu.
 
virtual void updateGUI ()
 Updates graphical user interface.
 
virtual void updateProgressBarClients ()
 Updates progress bar clients.
 
virtual void updateProgressBar (int currentProgress)
 Updates progress bar with the new value.
 

Protected Member Functions

void createFileMenu ()
 Creates file menu.
 
void createSaveSubmenu ()
 Creates save menu.
 
- Protected Member Functions inherited from GUI
void createStartAction (QMenu *menu, QString actionName, QString statusTip, QString shortcut)
 
void createStopAction (QMenu *menu, QString actionName, QString statusTip, QString shortcut)
 

Additional Inherited Members

- Public Slots inherited from GUI
void setGpu (int deviceID)
 Sets GPU based on user selection.
 
void setGpuList (QStringList gpuList)
 Sets GPU list and subsequently calls a function that constructs device sub-menu.
 
- Signals inherited from GUI
void tabSelected ()
 
void tabDeselected ()
 
void stateReceived (int newState)
 
void abortRequested ()
 
- Public Attributes inherited from GUI
QString binary
 
QString title
 
QString server
 
int instance
 
- Protected Attributes inherited from GUI
MainWindowmainWindow
 
SettingssettingsBase
 
InterfaceinterfaceBase
 
QSignalMapper * deviceSignalMapper
 
QMenu * fileMenu
 
QMenu * editMenu
 
QMenu * helpMenu
 
QMenu * deviceSubMenu
 
QMenu * moduleMenu
 
QAction * startAction
 
QAction * stopAction
 
QAction * settingsAct
 
QAction * deviceAct [MAX_GPU_DEVICES]
 
QAction * abortAct
 
QAction * quitAct
 
QAction * aboutAct [2]
 
QString tag
 
int progress
 
int status
 
bool selected
 
bool running
 
bool remoteMode
 
bool useModuleMenu
 
bool moduleConnected
 

Detailed Description

SOM graphical user interface

Constructor & Destructor Documentation

SOM::SOM ( MainWindow pMainWindow,
QString  binaryName,
QString  moduleTitle,
QString  serverName,
int  instanceID,
int  tabID = -1 
)

Constructor.

Parameters
[in]pMainWindow- pointer to MainWindow
[in]binaryName- name of module executable
[in]moduleTitle- title of this module
[in]server- server where the module runs
[in]instanceID- module identification number
[in]tabID- module tab index
SOM::~SOM ( )

Destructor.

SOM::SOM ( Interface pInterface)

Constructor.

Note
This constructor saves a pointer to the Interface object,
looks for GPU devices and sets default execution mode.
Parameters
[in]pInterface- pointer to Interface object

Member Function Documentation

void SOM::about ( )
protectedslot

Shows message box with the information about module.

Note
This is an overridden virtual function.
void SOM::createFileMenu ( )
protectedvirtual

Creates file menu.

Note
This is an overridden virtual function.

Reimplemented from GUI.

void SOM::createSaveSubmenu ( )
protected

Creates save menu.

int SOM::getDebugMessages ( )

Returns current debug message level.

Returns
debug - debugging level
int SOM::getDevice ( )

Returns current GPU device.

Returns
id - device id
float SOM::getHighestDataPoint ( )

Returns the highest data point found in the training data file.

Returns
highestDataPoint - highest data point
float SOM::getInitLearningRate ( )

Returns current initial learning rate.

Returns
initLearningRate - initial learning rate
int SOM::getIterationPause ( )

Returns current iteration pause value.

Returns
iterationPause - iteration pause
float SOM::getLowestDataPoint ( )

Returns the lowest data point found in the training data file.

Returns
lowestDataPoint - lowest data point
string SOM::getMapFile ( )

Returns the file name used for saving the trained self-organising map.

Returns
mapFileName - file name used for saving self-organising map
int SOM::getMaxThreads ( )

Returns current maximum number of threads per block.

Returns
maxThreads - maximum number of threads
int SOM::getNeighbourhoodSize ( )

Returns current neighbourhood size.

Returns
neighbourhoodSize - neighbourhood size
int SOM::getNumInputs ( )

Returns current number of inputs.

Returns
numInputs - number of inputs
int SOM::getNumOutputs ( )

Returns current number of outputs.

Returns
numOutputs - number of outputs
int SOM::getNumSamples ( )

Returns current number of samples.

Returns
numSamples - number of samples
int SOM::getNumSubiterations ( )

Returns current number of sub-iterations.

Returns
numSubiterations - number of sub-iterations
int SOM::getSeed ( )

Returns current seed.

Returns
seed - seed value
float SOM::getSigma ( )

Returns current sigma.

Returns
sigma - sigma value
string SOM::getTrainingFile ( )

Returns the trianing file name.

Returns
trainingFileName - training file name
float SOM::getTrainingTime ( )

Returns the time it took to train the slef-organising map.

Returns
trainingTime - training time
bool SOM::getVisualiseProgress ( )

Returns current progress visualisation mode.

Returns
visualiseProgress - progress visualisation
void SOM::getWeightsAsBottle ( Bottle *  bottle)

Loads the bottle with self-organising map's weigths.

Parameters
[out]bottle- weights
void SOM::loadTrainingSet ( Bottle  portData = 0)

Loads training data.

Note
This function can load the training data either from a local file or remotely via port
in which case portData bottle is passed as an input parameter.
Parameters
[in]portData- training data sent via port
void SOM::printGPUProperties ( int  deviceID)

Prints properties of a given GPU devices.

Parameters
[in]deviceID- id of a device whose properties are to be printed
void SOM::printOptions ( )

Prints options.

vector< string > SOM::queryGPU ( )

Returns detected GPU devices as a list of their names.

Returns
devices - names of GPU devices found on the system
void SOM::randomiseWeights ( )

Randomises self-organising map's weights.

void SOM::saveMap ( )

Saves trained self-organising map.

void SOM::setDebugMessages ( int  level)

Sets debug message mode.

Note
The level can be set to be 0,1,2 where 0 means no messages
1 is for only critical messages and 2 for all messages.
Parameters
[in]level- debugging level
void SOM::setDevice ( int  deviceID)

Sets current GPU device.

Parameters
[in]deviceID- device id
void SOM::setGPUMode ( bool  gpuMode)

Sets GPU mode.

Parameters
[in]gpuMode- GPU mode (on/off)
void SOM::setInitLearningRate ( float  value)

Sets the initial learning rate used during the training.

Note
This learning rate is then slowly lowered during the training.
Parameters
[in]value- initial learning rate
void SOM::setIterationPause ( int  value)

Sets the iteration pause.

Note
This iteration pause is used to make the training slower
so that Aquila can visualise the training process.
Parameters
[in]value- iteration pause
void SOM::setMapFile ( string  fileName)

Sets the file name used for saving the trained self-organising map.

Parameters
[in]fileName- file name used for saving self-organising map
void SOM::setMaxThreads ( int  value)

Sets maximum number of threads per blocks.

Parameters
[in]value- maximum number of threds
void SOM::setNeighbourhoodSize ( int  value)

Sets self-organising map's neighbourhood size.

Parameters
[in]value- neighbourhood size
void SOM::setNumInputs ( int  value)

Sets the number of inputs of self-organising map.

Parameters
[in]value- number of inputs
void SOM::setNumIterations ( int  value)

Sets the number of iterations used during the training.

Parameters
[in]value- number of iterations
void SOM::setNumOutputs ( int  value)

Sets the number of outputs of self-organising map.

Note
This function sets the outputs and automatically updates
the neighbourhood size and number of blocks.
Parameters
[in]value- number of outputs
void SOM::setNumSamples ( int  value)

Sets the total number of samples present in the training data.

Parameters
[in]value- number of samples
void SOM::setNumSubiterations ( int  value)

Sets the number of sub-iterations used during the training.

Parameters
[in]value- number of sub-iterations
void SOM::setSeed ( int  value)

Sets seed for random number generation.

Parameters
[in]value- seed value
void SOM::setSigma ( float  value)

Sets the sigma value used during the training.

Note
Sigma is set to zero by default. This function is experimental.
Parameters
[in]value- sigma
void SOM::setTrainingFile ( string  fileName)

Sets the file name containing the training data.

Parameters
[in]fileName- training file name
void SOM::setVisualiseProgress ( bool  visualise)

Sets the progress visualisation on/off.

Note
If the visualisation is on then this module sends the weights
of the self-organising map to the output port, which is typically
read and visualised by Aquila,.
Parameters
[in]visualise- progress visualisation (on/off)
void SOM::updateGUI ( )
protectedslot

Updates graphical user interface.

Note
This is an overridden virtual function.

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