bp.h

来自「用人工神经网络实现格林码的编码」· C头文件 代码 · 共 44 行

H
44
字号
// Bp.h: interface for the Bp class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BP_H__FFFFA0FB_8EC9_407C_83B1_C618CAC8A95E__INCLUDED_)
#define AFX_BP_H__FFFFA0FB_8EC9_407C_83B1_C618CAC8A95E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Sample.h"

#define N 4
#define H 10
#define M 2
#define MAX_SAMPLE  20
#define MAX_LOOP   3000
#define EPSILON  0.001
#define TEST_LOOP  20

class Bp  
{
public:

	FILE *f;
	Bp();
	virtual ~Bp();
	void InitializeRandom();
	int RandomInt(int low,int high);
	double RandomReal(double low,double high);
	void InputMultV(double input[],int n,double (*Vmatrix)[H],int h,double output[]);
	void HMultoutput(double hidden[],int h,double (*Wmatrix)[M],int m,double output[]);
	double  NetFunction(double net);
	void netoutput(Sample *question[],int questionnum,double(*w)[M],double(*v)[H],int h);
	void bpnet(double alph,Sample *samples[],int samplenum,double (*w)[M],double(*v)[H],int h);
	void  application();

	

};

#endif // !defined(AFX_BP_H__FFFFA0FB_8EC9_407C_83B1_C618CAC8A95E__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?