Click here to Skip to main content
15,886,788 members
Articles / Desktop Programming / MFC

Neural Network Classifier

Rate me:
Please Sign up or sign in to vote.
4.47/5 (23 votes)
29 Jan 2005CPOL2 min read 165.2K   8.4K   82  
A Multilayer perceptron used to classify blue and red points.
#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);
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) https://shahaab-co.com
Iran (Islamic Republic of) Iran (Islamic Republic of)
Currently I'm working at Dept. of Electrical Engineering in University of Shahrood.
Pattern Recognition (specially OCR), Neural Networks, Image Processing and Machine Vision are my interests. However I'm a PROGRAMMER as well.
BSc: Sharif University of technology @ 2002
MSc. and PhD: Tarbiat Modarres University @ 2006 & 2010 respectively

Personal Blog: Andisheh Online

Religious Blogs: Shia Muslims , Islamic Quotes

Company Site: Shahaab-co
My old Site: Farsi OCR

Comments and Discussions