?? bplayer.h
字號:
// BPLayer.h: interface for the CBPLayer class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BPLAYER_H__A1AD2505_132E_11D5_92B2_E4EDA6A40E5F__INCLUDED_)
#define AFX_BPLAYER_H__A1AD2505_132E_11D5_92B2_E4EDA6A40E5F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Matrix.h"
class CBPLayer
{
protected:
void F(void); //Y=F(V)
CMatrix DeltaF(); //F'()
public:
void ForWard(CMatrix & P1);//正向傳遞信息
CMatrix BackWard(CMatrix & E);//誤差反向傳遞,返回前層誤差
void initiate(unsigned int NumIn, unsigned int NumOut,unsigned int Mode, double l);
double lr;//學習速度
CMatrix *P;//輸入矩陣
CMatrix W;//權系數矩陣
CMatrix B;//偏差矩陣
CMatrix V;//V=W*P+B
CMatrix Y;//Y=F(V)
//CMatrix dw;//dw=D*P'*lr
//CMatrix db;//db=D*ones()*lr
CMatrix D;//D=F'().*E
enum FunctionMode
{
purelin=0x0,
logsig=0x1,
tansig=0x2
}FunctionType;
CBPLayer();
virtual ~CBPLayer();
};
class CBPNet
{
public:
CEdit * m_message;
void Train();
void BackWard();
void ForWard();
void init(CEdit * edit_message,double m_lr,int m_num);
CBPNet();
virtual ~CBPNet();
CMatrix P, T, Y, E;//輸入矩陣,期望輸出,實際輸出
CBPLayer l1,l2;//兩層
double sse;//輸出誤差
double err_goal;//期望誤差
double lr;//學習速率
unsigned int max_epoch;//最大循環次數
};
#endif // !defined(AFX_BPLAYER_H__A1AD2505_132E_11D5_92B2_E4EDA6A40E5F__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -