Aquila  2.0 prealpha
Cognitive Robotics Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtrnn.h
Go to the documentation of this file.
1 //##############################################################################################################################################################################################################//
2 //Aquila - An Open-Source GPU-Accelerated Toolkit for Cognitive and Neuro-Robotics Research //
3 // //
4 //Copyright (c) <2012>, <Martin Peniak - www.martinpeniak.com> //
5 //All rights reserved. //
6 // //
7 //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: //
8 // //
9 // - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. //
10 // - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. //
11 // //
12 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR //
13 //A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT //
14 //LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR //
15 //TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //
16 // //
17 //The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted //
18 //as representing official policies,either expressed or implied, of the FreeBSD Project. //
19 //##############################################################################################################################################################################################################//
20 
21 #ifndef MTRNN_H
22 #define MTRNN_H
23 
24 #include <QWidget>
25 #include <QStringList>
26 #include "mainWindow.h"
27 #include "ui_mainWindow.h"
28 #include "ui_mtrnn.h"
29 #include "mtrnnSettings.h"
30 #include "mtrnnInterface.h"
31 #include "plot2d.h"
32 
33 namespace Ui
34 {
35  class MTRNN;
36 }
37 
39 class MTRNN : public GUI
40 {
41  Q_OBJECT
42 
43 public:
44  MTRNN(MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1);
45  ~MTRNN();
46 
47 private:
48  Ui::MTRNN *ui;
49  MTRNNInterface *intrfc;
50  MTRNNSettings *settings;
51 
52  QSignalMapper *saveSignalMapper;
53  QMenu *saveSubMenu;
54  QAction *trainAct;
55  QAction *saveAct[3];
56 
57  int numControlNeurons;
58  int numLinguisticNeurons;
59  int numVisionNeurons;
60  int numActionNeurons;
61  float maxError;
62  float minError;
63  float maxValue;
64  float minValue;
65 
66  void setupGUI();
67  void resetErrorLimits();
68  void initPlot();
69 
70 protected slots:
71  void about();
72  void updateGUI();
73 
74 protected:
75  void createFileMenu();
76  void createSaveSubmenu();
77 
78 private slots:
79  void save(int targetID);
80  void save(QVector<float> network);
81  void saveErrors(QVector<float> trainingErrors);
82  bool loadTrainingData(QString trainingFile);
83  void startTraining();
84  void updatePlot(int step, float error);
85 };
86 
87 #endif//MTRNN_H