neuron.h

来自「多层神经网络范例 http://www.codeproject.com/cpp」· C头文件 代码 · 共 44 行

H
44
字号
#pragma once
#include <afxtempl.h>
class Synapse;

class Neuron
{
public:
	~Neuron(void);
	static double momentum;// = 0.9;
	static double learningRate;// = 0.05;
	
	CList<Synapse*> inlinks;
	CList<Synapse*> outlinks;
//private:
	double output; // range from 0.0 to 1.0
	double sum;
	double delta;
	CString label;
public:
	Neuron(CString s)
	{
		output   = 0.0;
		delta    = 0.0;
		sum      = 0.0;
		inlinks.RemoveAll();
		outlinks.RemoveAll();
		label    = s;
	}
public:
	double getOutput()
	{
		return output;
	}
	double getDelta()
	{
		return delta;
	}
	void computeOutput();
	void computeBackpropDelta(double d); // for an output neuron
	void computeBackpropDelta(); // for a hidden neuron
	void computeWeight();
	CString print();
	int SetWeights(double* pWeights);
};

⌨️ 快捷键说明

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