-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
68 lines (48 loc) · 1.23 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "exampledialog.h"
#include "mlpdialog.h"
#include "qmlp.h"
#include "qcustomplot.h"
#include "loadmnistdialog.h"
class MLPThread;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void compute();
void updateDisplay(const qreal & second);
void computeFinished();
void resetMLP(qint64 HL = -1, qint64 PL = -1);
void on_Examples_clicked();
void on_MLP_clicked();
private:
Ui::MainWindow *ui;
loadMNISTDialog *mnistWindow;
exampleDialog *exampleWindow;
MLPDialog *mlpWindow;
QMLP *mlp;
MLPThread *thread;
};
/********************************************/
class MLPThread : public QThread
{
Q_OBJECT
public:
MLPThread(QObject* parent, QMLP* mlp): QThread(parent), _mlp(mlp),_str() {}
void start (const QString &str) { _str=str; QThread::start();}
void run() Q_DECL_OVERRIDE { _mlp->learn(_str); emit finished();}
signals:
void finished();
private:
QMLP *_mlp;
QString _str;
};
#endif // MAINWINDOW_H