Click here to Skip to main content
12,952,575 members (34,842 online)
Click here to Skip to main content


79 bookmarked
Posted 29 Jan 2005

Neural Network Classifier

, 29 Jan 2005 CPOL
A Multilayer perceptron used to classify blue and red points.
// MultiLayerPerceptronDlg.h : header file

#pragma once
#include "Perceptron.h"
#include "ErrorDlg.h"
#include "afxwin.h"

// CMultiLayerPerceptronDlg dialog
class CMultiLayerPerceptronDlg : public CDialog
// Construction
	CMultiLayerPerceptronDlg(CWnd* pParent = NULL);	// standard constructor
	~CMultiLayerPerceptronDlg()// standard destructor
		delete m_ErrorDlg;

// Dialog Data

	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

	Perceptron* perceptron;

	void initPerceptron();
	void learnPoints();
	void setSamples();
	void UpdateDisplay();
// Implementation
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedInit();
	// number of neuron in hidden layer
	UINT m_hidSize[3];
	static const n_in  = 2;//10*10;
	static const n_out = 1;//32;
	double m_dLearningRate;
	double m_dMomentum;
	CErrorDlg *m_ErrorDlg;
	CArray<CPoint> m_RedPts,m_BluePts;//Sample points from user
	float m_fRedRatio[600][800];
	afx_msg void OnBnClickedLearn();
	long m_nIter;
	CComboBox m_cmbColor;
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnBnClickedClear();
	double m_dTargetError;
	BOOL m_bWritetoFile;
	afx_msg void OnBnClickedShowError();
	afx_msg void OnBnClickedLoadWeights();
	afx_msg void SaveWeights();
	CString m_strErrorFile;
	afx_msg void OnBnClickedWritetofile();

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.


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


About the Author

Hossein Khosravi
Software Developer (Senior)
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 , Ashura , Islamic Quotes

Commercial Site: Farsi OCR

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 30 Jan 2005
Article Copyright 2005 by Hossein Khosravi
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid