-
Notifications
You must be signed in to change notification settings - Fork 1
/
NNDoc.h
162 lines (124 loc) · 3.75 KB
/
NNDoc.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// NNDoc.h : interface of the CNNDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_NNDOC_H__26A63D2C_6CBB_11D4_9E62_EF8715B56461__INCLUDED_)
#define AFX_NNDOC_H__26A63D2C_6CBB_11D4_9E62_EF8715B56461__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "NeuralNet.h"
#define WM_USER_NN_CHUNK_CALC_FINISHED (WM_USER + 1)
class CNNDoc : public CDocument
{
protected: // create from serialization only
CNNDoc();
DECLARE_DYNCREATE(CNNDoc)
// Attributes
public:
PointList m_PtLst;
NeuralNet m_NNet;
int m_CurrentIteration;
int m_NetTrainingMethod;
//growing neural gas
int m_GNGAgeMax;
double m_GNGAlpha;
double m_GNGBetta;
int m_GNGChunkSize;
double m_GNGEpsB;
double m_GNGEpsN;
int m_GNGRunLength;
int m_GNGNeuronNumber;
int m_GNGLambdaGrowth;
// Neural Gas
int m_NGChunkSize;
int m_NGEdgeExperationAgeFinal;
double m_NGFinalEps;
double m_NGFinalLambda;
double m_NGInitEps;
double m_NGInitLambda;
int m_NGEdgeExperationAgeInit;
int m_NGNeuronNumber;
int m_NGRunLength;
int m_NGEdgeExperationAgeNextChunk;
double m_NGEpsNextChunk;
double m_NGLambdaNextChunk;
// self organizing feature map
int m_SOFMChunkSize;
double m_SOFMFinalEps;
double m_SOFMInitEps;
double m_SOFMRadiusFinal;
double m_SOFMRadiusInit;
int m_SOFMRunLength;
double m_SOFMSigmaFinal;
double m_SOFMSigmaInit;
int m_SOFMNeuronNumberU;
int m_SOFMNeuronNumberV;
BOOL m_SOFMGridCanGrow;
BOOL m_SOFMCyclicUDir;
BOOL m_SOFMCyclicVDir;
double m_SOFMEpsNextChunk;
double m_SOFMRadiusNextChunk;
double m_SOFMSigmaNextChunk;
int m_SOFMBoundaryCorrectionEvery;
double m_SOFMBoundaryCorrectionPointWeight;
int m_SOFMBoundaryCorrectionRunLength;
int m_SOFMLambdaGrowth;
CCriticalSection m_UpdatingListsNow;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNNDoc)
public:
virtual BOOL OnNewDocument();
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
BOOL ChangeNetTrainingParameters();
LRESULT OnFinishedTrainingChunk(WPARAM wParam, LPARAM lParam);
void TrainNetOneChunk();
void TrainNetContinously();
virtual ~CNNDoc();
friend UINT TrainInThread(LPVOID pParam);
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CNNDoc)
afx_msg void OnButtonPauseNetTraining();
afx_msg void OnButtonTrainNetContinous();
afx_msg void OnButtonTrainNetOneStep();
afx_msg void OnButtonChangeTrainingParameters();
afx_msg void OnButtonChangeNetworkType();
afx_msg void OnButtonTriangulateNet();
afx_msg void OnButtonCloseLoops();
afx_msg void OnButtonDeleteNonManifoldNeurons();
afx_msg void OnButtonDetectNonManifoldNeurons();
afx_msg void OnButtonCalcNormalsUsingLsq();
afx_msg void OnButtonDeleteNonManifoldFaces();
afx_msg void OnButtonInitiateEnhancedHebbianLearning();
afx_msg void OnButtonResetNormalDirections();
afx_msg void OnButtonResetNeuronPositionsToRandomSamplePoint();
afx_msg void OnButtonResetNeuronPositionsToNearestSamplePoint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
BOOL m_TrainingNetNow;
BOOL m_TrainingContinously;
BOOL m_TerminateThread;
private:
void ChangeNetworkType(LPCTSTR FileName);
public:
void WaitUntilThreadTerminates(void);
};
/////////////////////////////////////////////////////////////////////////////
// global decleration
UINT TrainInThread(LPVOID pParam);
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NNDOC_H__26A63D2C_6CBB_11D4_9E62_EF8715B56461__INCLUDED_)