?? nnbpdlg.h
字號:
// NNBPDlg.h : header file
//
#if !defined(AFX_NNBPDLG_H__C646FE1F_4498_483B_8CFF_EC573C349AEB__INCLUDED_)
#define AFX_NNBPDLG_H__C646FE1F_4498_483B_8CFF_EC573C349AEB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//***************************************************************************
// Add the required header files
#include "Matrix.h"
#include "BtnST.h"
#include "StaticFader.h"
//
//***************************************************************************
/////////////////////////////////////////////////////////////////////////////
// Levenberg-Marquart ----> 第一次前向計算初始化 //
/////////////////////////////////////////////////////////////////////////////
__declspec (dllimport) void LMForwardCalculateInit( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerValveValue
);
/////////////////////////////////////////////////////////////////////////////
// Levenberg-Marquart ----> 前向計算 //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllimport) void LMForwardCalculate ( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
bool bSimulateDataFlag,
int nComboFunc,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideLayerOutput,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerOutput,
CMatrix &matrixOutputLayerValveValue
);
/////////////////////////////////////////////////////////////////////////////
// Levenberg-Marquart ----> 反饋計算 //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllimport) bool LMDemoDataTrainRepeat ( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
bool bSimulateDataFlag,
int nComboFunc,
double nSystemErrorOld,
double nSystemErrorNew,
double nSystemErrorLevel,
double nSystemError,
double nStep,
UINT nMaxTrainTimes,
UINT nTrainTimes,
DWORD ID_SYSTEM_ERROR,
DWORD ID_TRAIN_TIMES,
HWND hWnd,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideLayerOutput,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerOutput,
CMatrix &matrixOutputLayerValveValue
);
/////////////////////////////////////////////////////////////////////////////
// Back propagation ----> 前向計算(Only for Training) //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllexport) void BPForwardCalculate ( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
bool bSimulateDataFlag,
int nComboFunc,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideLayerOutput,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerOutput,
CMatrix &matrixOutputLayerValveValue,
CMatrix &cMatrixExHideLayerValveValue,
CMatrix &cMatrixExOutputLayerValveValue
);
/////////////////////////////////////////////////////////////////////////////
// Back propagation ----> 前向計算(Only for Simulating) //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllimport) void BPForwardCalculate2( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
bool bSimulateDataFlag,
int nComboFunc,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideLayerOutput,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerOutput,
CMatrix &matrixOutputLayerValveValue
);
/////////////////////////////////////////////////////////////////////////////
// Back propagation ----> 反饋計算 //
/////////////////////////////////////////////////////////////////////////////
__declspec(dllimport) bool BPDemoDataTrainRepeat ( int nInputLayerNumber,
int nHideLayerNumber,
int nOutputLayerNumber,
bool bSimulateDataFlag,
int nComboFunc,
double nSystemErrorOld,
double nSystemErrorNew,
double nSystemErrorLevel,
double nSystemError,
double nStep,
UINT nMaxTrainTimes,
UINT nTrainTimes,
DWORD ID_SYSTEM_ERROR,
DWORD ID_TRAIN_TIMES,
HWND hWnd,
CMatrix &matrixDemoDataInput,
CMatrix &matrixInputLayerValue,
CMatrix &matrixInputToHideWeightValue,
CMatrix &matrixHideLayerValveValue,
CMatrix &matrixHideLayerOutput,
CMatrix &matrixHideToOutputWeightValue,
CMatrix &matrixOutputLayerOutput,
CMatrix &matrixOutputLayerValveValue
);
//***************************************************************************
class CNNBPDlg;
/////////////////////////////////////////////////////////////////////////////
// 線程結構體
struct STHREADDATA
{
CNNBPDlg *pDlg;
};
//***************************************************************************
/////////////////////////////////////////////////////////////////////////////
// CNNBPDlg dialog
class CNNBPDlg : public CDialog
{
// Construction
public:
CNNBPDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNNBPDlg)
enum { IDD = IDD_NNBP_DIALOG };
CComboBox m_ctrlComboArithmetic;
CComboBox m_ctrlComboFunc;
CStaticFader m_staticTextTitle;
CButtonST m_btnState;
CButtonST m_btnSimuResultBrowser;
CButtonST m_btnSimuNetworkFoldBrowser;
CButtonST m_btnSimuDataInputBrowser;
CButtonST m_btnDemoSaveResultBrowser;
CButtonST m_btnDemoSaveNetworkBrowser;
CButtonST m_btnDemoDataInputBrowser;
CButtonST m_btnStopTrain;
CButtonST m_btnExit;
CButtonST m_btnAboutUs;
CButtonST m_btnBeginTrain;
CString m_strDemoDataInput;
CString m_strDemoSaveResult;
UINT m_nInputLayerNumber;
UINT m_nHideLayerNumber;
UINT m_nOutputLayerNumber;
int m_nComboFunc;
double m_nSystemError;
UINT m_nTrainTimes;
double m_nSystemErrorLevel;
UINT m_nMaxTrainTimes;
CString m_strDemoSaveNetwork;
CString m_strSimuNetworkFold;
CString m_strSimuDataInput;
CString m_strSimuResult;
int m_nComboArithmetic;
double m_nStep;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNNBPDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CNNBPDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnExit();
afx_msg void OnAboutus();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDemoDataInputBrowser();
afx_msg void OnDemoSaveNetworkBrowser();
afx_msg void OnDemoSaveResultBrowser();
afx_msg void OnSimuNetworkFoldBrowser();
afx_msg void OnSimuDataInputBrowser();
afx_msg void OnSimuResultBrowser();
afx_msg void OnBeginTrain();
afx_msg void OnState();
afx_msg void OnStopTrain();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
// 是否開始訓練的標志
bool m_bStartFlag;
// 是樣本訓練還是數據仿真?
bool m_bSimulateDataFlag;
// 數據仿真
bool SimulateData();
// 樣本訓練
bool TrainingDemo();
private:
// 向文件中寫入常量字符串
bool SaveConstantStringToFile(CString& strFileName,CString& strConstantData);
// 前向計算初始化
void ForwardCalculateInit();
// 反復訓練
bool DemoDataTrainRepeat();
// 用于存儲輸入的樣本數據的矩陣
CMatrix m_matrixDemoDataInput;
// 樣本的輸入層的數值矩陣
CMatrix m_matrixInputLayerValue;
// 輸入層到隱含層的權值矩陣
CMatrix m_matrixInputToHideWeightValue;
// 隱含層的閥值矩陣
CMatrix m_matrixHideLayerValveValue;
// 隱含層到輸出層的權值矩陣
CMatrix m_matrixHideToOutputWeightValue;
// 輸出層的閥值矩陣
CMatrix m_matrixOutputLayerValveValue;
// 隱含層的輸出值的矩陣
CMatrix m_matrixHideLayerOutput;
// 輸出層的輸出值的矩陣
CMatrix m_matrixOutputLayerOutput;
// 用來仿真時輸入的網絡參數矩陣
CMatrix m_matrixSimuNetwork;
// 用來存放仿真數據結果的矩陣
CMatrix m_matrixSimuResult;
// 創建新的線程的線程句柄
HANDLE m_hThread;
// 系統誤差
double m_SystemErrorNew;
double m_SystemErrorOld;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NNBPDLG_H__C646FE1F_4498_483B_8CFF_EC573C349AEB__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -