📄 bpnetdlg.h
字号:
// BPnetDlg.h : header file
//
#if !defined(AFX_BPNETDLG_H__19A0C0C0_0A87_4770_94F7_08577BDF0E1D__INCLUDED_)
#define AFX_BPNETDLG_H__19A0C0C0_0A87_4770_94F7_08577BDF0E1D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// #define N 100 //学习样本个数
#define Z 100 //旧权值保存-》每次study的权值都保存下来
/////////////////////////////////////////////////////////////////////////////
// CBPnetDlg dialog
#include "WBButton.h"
class CBPnetDlg : public CDialog
{
// Construction
public:
CDC* pDC;
double Pre_error;
int IN1;
int HN;
int ON;
void picture5();
void picture4();
void picture3();
void picture2();
void picture1();
double sum_err;
double abs_err[10];//每个样本的绝对误差都是从0开始的
double T[200]; //单个样本教师数据
double Twork[200];//用于泛化样本
double P[10]; //单个样本输入数据(用于训练样本)
double Winitial[10][10];
double Pwork[10];// 用于泛化样本
double W[10][10]; //输入层至隐层权值
double V[10][10]; //隐层至输出层权值
double Vinitial[10][10];
double X[10]; //隐层的输入
double Xwork[10];
double Y[10]; //输出层的输入
double Ywork[10];
double H[10]; //隐层的输出
double Hwork[10];
double O[10]; //输出层的输出
double Owork[10];
double YU_HN[10]; //隐层的阈值
double YU_HNinitial[10];
double YU_ON[10]; //输出层的阈值
double YU_ONinitial[10];
double err_m[200]; //第m个样本的总误差
//double a; //输出层至隐层的学习效率
double b;//隐层至输入层学习效率
double Wold[10][10];
double Vold[10][10];
struct {
double input[10]; //输入在上面定义是三个
double teach[10]; //输出在上面定义是二个
}Study_Data[200];//学习样本
//定义一个放学习样本的结构
struct {
double input[10]; //输入在上面定义是三个
double teach[10]; //输出在上面定义是二个
}Work_Data[200];//学习样本
struct
{
double O[10];
double T[10];
}
fanhua[200];
double old_W[10][10]; //保存HN-IN旧权!
double old_V[10][10]; //保存ON-HN旧权!
////////启动时缩放画面功能
CRect DesktopRect;
int TIMER;
int flagsuofang;
int dlgDx; // -递增的宽
int dlgDy ; //- 递增的高
int dlgWidth; //- 最终宽度
int dlgHeight; //- 最终高度
CBPnetDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CBPnetDlg)
enum { IDD = IDD_BPNET_DIALOG };
CWBButton m_button6;
CWBButton m_button7;
CWBButton m_button5;
CWBButton m_button4;
CWBButton m_button3;
CWBButton m_button2;
CWBButton m_button1;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBPnetDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
//
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CBPnetDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnGetdata();
afx_msg void OnInitial();
afx_msg void OnTrain();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnSet();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDelete();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CWnd *pWnd;
bool flaglast;
void lastpicture();
void handpicture6();
bool flagdynamic;
void errworkpicture();
void Err_O_Hwork(int m);
void O_I_Owork();
void H_I_Owork();
void saveWV();
double err[100];
double errwork[100];
bool flagerrpicture;
POINT point;
void errpicture();
void handpicture7();
void handpicture4();
void handpicture3();
void handpicture2();
void handpicture1();
void dynamicpicture4();
void dynamicpicture3();
void dynamicpicture2();
void dynamicpicture1();
void introducepicture();
void clear4();
void clear3();
void clear2();
void clear1();
CPen pen4;
void input_Twork(int m);
void input_Pwork(int m);
CFont font1;
CFont font2;
CFont font3;
CPen pen3;
void picture();
CPen pen2;
CPen pen5;
CPen pen6;
int Flagpicture;
void Delta_H_I(int m, int n);
void Delta_O_H(int m,int n);
void Err_H_I();
double e_err[10];
void Err_O_H(int m);
double d_err[10];
void O_I_O();
void H_I_O();
void intput_T(int m);
void intput_P(int m);
CBrush m_brush2;
CBrush m_brush;
CString inputdatafile1;
CString inputdatafile;
CPen pen1;
bool buttonflag1;
bool buttonflag2;
bool buttonflag3;
bool buttonflag4;
bool buttonflag5;
bool flaghand1;
bool flaghand2;
bool flaghand3;
bool flaghand4;
bool flaghand6;
bool flaghand7;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BPNETDLG_H__19A0C0C0_0A87_4770_94F7_08577BDF0E1D__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -