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

#include <mtrnn.h>

Inheritance diagram for MTRNN:
GUI

Public Member Functions

 MTRNN (MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1)
 Constructor.
 
 ~MTRNN ()
 Destructor.
 
 MTRNN (Interface *pInterface)
 Constructor.
 
void initialise ()
 Initialialises everything and starts the training.
 
void deinitialise ()
 Deinitialises everything and deallocates memory.
 
void saveNetwork ()
 Saves trained neural network.
 
void testNetwork ()
 Tests the accuracy of the trained neural network.
 
void randomiseWeights ()
 Randomises weights and initialise connectivity.
 
bool loadTrainingData ()
 Loads training data.
 
vector< string > queryGPU ()
 Returns detected GPU devices as a list of their names.
 
void printGPUProperties (int deviceID)
 Prints properties of a given GPU devices.
 
void printOptions ()
 Prints a list of possible arguments that can be set.
 
void printConfiguration ()
 Prints general configuration.
 
void printKernelConfiguration ()
 Prints kernel configurations.
 
void printNetworkConfiguration ()
 Prints general neural network configuration.
 
void setGPUMode (bool gpuMode)
 Sets GPU mode.
 
void setDebuggingLevel (int level)
 Sets the level of debugging.
 
void setTrainingFile (string fileName)
 Sets training file.
 
void setTrainingData (Bottle data)
 Sets training data received from port.
 
void setNetworkFile (string fileName)
 Sets neural network file.
 
void setShowProgress (bool show)
 Sets progress displaying mode .
 
void setMaxThreads (int threads)
 Sets the maximum number of threads per block.
 
void setMaxIterations (int iterations)
 Sets the maximum number of iterations and allocates memory for storing of the errors.
 
void setSeed (int value)
 Sets seed.
 
void setIODeltaT (int value)
 Sets delta-t value for input-output neurons.
 
void setFastDeltaT (int value)
 Sets delta-t value for fast neurons.
 
void setSlowDeltaT (int value)
 Sets delta-t value for slow neurons.
 
void setNumFastNeurons (int fastNeurons)
 Sets number of fast neurons.
 
void setNumSlowNeurons (int slowNeurons)
 Sets number of slow neurons.
 
void setInitWeightRange (float value)
 Sets the initial range for weights.
 
void setThreshold (float value)
 Sets thrshold.
 
void setLearningRate (float value)
 Sets learning rate.
 
void setMomentum (float value)
 Sets momentum.
 
void setDevice (int deviceID)
 Sets current GPU device.
 
void setDevices (int deviceID[MAX_GPU_DEVICES])
 Sets mulitple GPU devices, enables P2P mode where possible.
 
void setDeltaT ()
 Sets delta-t values of all neurons.
 
void setGridBlock ()
 Sets grid and block sizes.
 
void setFeedbackInterval (int interval)
 Sets the feedback interval.
 
void getWeightsAsBottle (Bottle *bottle)
 Loads the bottle with neural network's weigths.
 
void getErrorsAsBottle (Bottle *bottle)
 Loads the bottle with training errros.
 
int getDevice ()
 Gets currently set GPU device.
 
int getNumDevices ()
 Gets the number of detected GPU devices.
 
int getProgress ()
 Calculates the training progress in %.
 
int getMaxIterations ()
 Gets the maximum number of iterations.
 
int getSeed ()
 Gets current seed value.
 
int getNumFastNeurons ()
 Gets the number of fast context neurons.
 
int getNumSlowNeurons ()
 Gets the number of slow context neurons.
 
int getIODeltaT ()
 Gets the delta-t value of the input-output neurons.
 
int getFastDeltaT ()
 Gets the delta-t value of the fast context neurons.
 
int getSlowDeltaT ()
 Gets the delta-t value of the slow context neurons.
 
int getDebuggingLevel ()
 Gets current debug level.
 
int getFeedbackInterval ()
 Gets current feedback interval.
 
float getLearningRate ()
 Gets current learning rate.
 
float getMomentum ()
 Gets current momentum.
 
float getWeightRange ()
 Gets the initial range used for generating random number of weights.
 
float getThreshold ()
 Gets current threshold.
 
string getNetworkFile ()
 Gets file name used for saving trained network.
 
string getTrainingFile ()
 Gets file name used for network training.
 
- Public Member Functions inherited from GUI
 GUI (MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1)
 Constructor.
 
 ~GUI ()
 Destructor.
 

Public Attributes

bool terminalMode
 
- Public Attributes inherited from GUI
QString binary
 
QString title
 
QString server
 
int instance
 

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 ()
 
- 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

MTRNN graphical user interface

Constructor & Destructor Documentation

MTRNN::MTRNN ( 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
MTRNN::~MTRNN ( )

Destructor.

MTRNN::MTRNN ( 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

Member Function Documentation

void MTRNN::about ( )
protectedslot

Shows message box with the information about module.

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

Creates file menu.

Note
This is an overridden virtual function.

Reimplemented from GUI.

void MTRNN::createSaveSubmenu ( )
protected

Creates save menu.

void MTRNN::deinitialise ( )

Deinitialises everything and deallocates memory.

int MTRNN::getDebuggingLevel ( )

Gets current debug level.

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

Gets currently set GPU device.

Returns
id - device id
void MTRNN::getErrorsAsBottle ( Bottle *  bottle)

Loads the bottle with training errros.

Parameters
[out]bottle- errors
int MTRNN::getFastDeltaT ( )

Gets the delta-t value of the fast context neurons.

Returns
fastDeltaT - fast delta-t
int MTRNN::getFeedbackInterval ( )

Gets current feedback interval.

Returns
feedbackInterval - feedback interval
int MTRNN::getIODeltaT ( )

Gets the delta-t value of the input-output neurons.

Returns
ioDeltaT - input-output delta-t
float MTRNN::getLearningRate ( )

Gets current learning rate.

Returns
learningRate - learning rate
int MTRNN::getMaxIterations ( )

Gets the maximum number of iterations.

Returns
maxIterations - maximum number of iterations
float MTRNN::getMomentum ( )

Gets current momentum.

Returns
momentum - current momentum
string MTRNN::getNetworkFile ( )

Gets file name used for saving trained network.

Returns
networkFileName - neural network file name used for saving
int MTRNN::getNumDevices ( )

Gets the number of detected GPU devices.

Returns
availableGPUs - number of available devices
int MTRNN::getNumFastNeurons ( )

Gets the number of fast context neurons.

Returns
numFastNeurons - number of fast neurons
int MTRNN::getNumSlowNeurons ( )

Gets the number of slow context neurons.

Returns
numSlowNeurons - number of slow neurons
int MTRNN::getProgress ( )

Calculates the training progress in %.

Returns
progress - current progress
int MTRNN::getSeed ( )

Gets current seed value.

Returns
seed - current seed
int MTRNN::getSlowDeltaT ( )

Gets the delta-t value of the slow context neurons.

Returns
slowDeltaT - slow delta-t
float MTRNN::getThreshold ( )

Gets current threshold.

Returns
threshold - current threshold
string MTRNN::getTrainingFile ( )

Gets file name used for network training.

Returns
trainingFileName - training file name
float MTRNN::getWeightRange ( )

Gets the initial range used for generating random number of weights.

Returns
initWeightRange - initial weight range
void MTRNN::getWeightsAsBottle ( Bottle *  bottle)

Loads the bottle with neural network's weigths.

Parameters
[out]bottle- weights
void MTRNN::initialise ( )

Initialialises everything and starts the training.

bool MTRNN::loadTrainingData ( )

Loads training data.

void MTRNN::printConfiguration ( )

Prints general configuration.

void MTRNN::printGPUProperties ( int  deviceID)

Prints properties of a given GPU devices.

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

Prints kernel configurations.

Note
Different kernels can be launched with different parameters and this function prints
all the configurations used throughtout the program.
void MTRNN::printNetworkConfiguration ( )

Prints general neural network configuration.

void MTRNN::printOptions ( )

Prints a list of possible arguments that can be set.

vector< string > MTRNN::queryGPU ( )

Returns detected GPU devices as a list of their names.

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

Randomises weights and initialise connectivity.

Note
Weights that are set to zero are not used.
void MTRNN::saveNetwork ( )

Saves trained neural network.

void MTRNN::setDebuggingLevel ( int  level)

Sets the level of debugging.

Note
When level 0 = no messages, level 1 = critical messages, level 2 = all messages.
Parameters
[in]level- debuggine level
void MTRNN::setDeltaT ( )

Sets delta-t values of all neurons.

void MTRNN::setDevice ( int  deviceID)

Sets current GPU device.

Parameters
[in]deviceID- device id
void MTRNN::setDevices ( int  deviceID[MAX_GPU_DEVICES])

Sets mulitple GPU devices, enables P2P mode where possible.

Parameters
[in]deviceID[]- list of IDs of GPU devices to be added
void MTRNN::setFastDeltaT ( int  value)

Sets delta-t value for fast neurons.

Parameters
[in]value- fast delta-t value
void MTRNN::setFeedbackInterval ( int  interval)

Sets the feedback interval.

Parameters
[in]interval- feedback interval
void MTRNN::setGPUMode ( bool  gpuMode)

Sets GPU mode.

Parameters
[in]gpuMode- if true run in GPU mode else run in CPU mode
void MTRNN::setGridBlock ( )

Sets grid and block sizes.

Note
This is used for kernel invocations.
void MTRNN::setInitWeightRange ( float  value)

Sets the initial range for weights.

Note
If the value is for example 1.0 then the range will be from -1.0 to 1.0.
Parameters
[in]value- initial weight range value
void MTRNN::setIODeltaT ( int  value)

Sets delta-t value for input-output neurons.

Parameters
[in]value- input-output delta-t value
void MTRNN::setLearningRate ( float  value)

Sets learning rate.

Parameters
[in]value- learning rate value
void MTRNN::setMaxIterations ( int  iterations)

Sets the maximum number of iterations and allocates memory for storing of the errors.

Parameters
[in]iterations- maximum number of iterations
void MTRNN::setMaxThreads ( int  threads)

Sets the maximum number of threads per block.

Parameters
[in]threads- maximum number of threads
void MTRNN::setMomentum ( float  value)

Sets momentum.

Parameters
[in]value- momentum value
void MTRNN::setNetworkFile ( string  fileName)

Sets neural network file.

Parameters
[in]fileName- file name used for saving of neural network
void MTRNN::setNumFastNeurons ( int  fastNeurons)

Sets number of fast neurons.

Parameters
[in]fastNeurons
void MTRNN::setNumSlowNeurons ( int  slowNeurons)

Sets number of slow neurons.

Parameters
[in]slowNeurons- number of slow neurons
void MTRNN::setSeed ( int  value)

Sets seed.

Parameters
[in]value- seed value
void MTRNN::setShowProgress ( bool  show)

Sets progress displaying mode .

Parameters
[in]show- if true progress will be shown
void MTRNN::setSlowDeltaT ( int  value)

Sets delta-t value for slow neurons.

Parameters
[in]value- slow delta-t value
void MTRNN::setThreshold ( float  value)

Sets thrshold.

Parameters
[in]value- threshold value
void MTRNN::setTrainingData ( Bottle  data)

Sets training data received from port.

Parameters
[in]data- training data
void MTRNN::setTrainingFile ( string  fileName)

Sets training file.

Parameters
[in]fileName- training file name
void MTRNN::testNetwork ( )

Tests the accuracy of the trained neural network.

void MTRNN::updateGUI ( )
protectedslot

Updates graphical user interface.

Note
This is an overridden virtual function.

Member Data Documentation

bool MTRNN::terminalMode

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