Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Neural Dot Net Pt 3 The Adaline Network

, 23 Oct 2003
A neural network library in C#.
neural_dot_net_2002.zip
Neural Dot Net 2002
App.ico
bin
Debug
AdalineWordFile.dat
adalinewordWorkingFile.wrk
adword.trn
App.ico
BackpropagationWorkingFile.wrk
Lin2Var.trn
Neural Dot Net 2002.exe
Neural Net Library.dll
SelfOrganizingNetworkOne.trn
SelfOrganizingNetworkOne.wrk
SelfOrganizingNetworkOneTest.tst
SharpUtils.dll
SharpUtils.pdb
equations.Bak
Neural Dot Net 2002.csproj.user
Neural Net Library
bin
Debug
Neural Net Library.csproj.user
Neural Net Library.suo
obj
Debug
Neural Net Library.projdata
temp
TempPE
SharpUtils
bin
Debug
obj
Debug
SharpUtils.projdata
temp
TempPE
SharpUtils.csproj.user
SharpUtils.suo
neural_network_first_release.zip
Neural Network First release
3e5b39da.jpg
3e5b3ee8.jpg
3e65d686.jpg
3e65d687.jpg
Adaline.png
AdalineOneOptions.png
AdalineTwoOptions.jpg
AdalineWordClassDiagram.png
Adalinewordpattern.png
Addwordtoadalinetwofile.png
Backpropagationclasses.png
BackPropagationOneDiagram.png
backpropagationoneoptions.png
BackPropagationWordDiagram.png
BackPropagationWordOptions.png
BackPropagationWordPattern.png
Basic.png
BasicLinkWorks.png
BasicNetworkTester Overview.png
BasicNeuronComponent.png
changedBasicClassDiagram.png
equationTest.jpg
equationwithbias.jpg
function.jpg
Generating a given File.png
Inside Adaline Transition Function.png
Inside Self Organizing network run.png
Inside The Adaline Run Function Plus Bias.png
Inside The Adaline Run Function.png
learn For the self organizing network.png
Learning For the Backpropagation Network.png
LogViewer
LogViewer.csproj.user
Neural Net Library
Adaline.png
Adalinewordpattern.png
BackPropagation.emf
Basic.png
librarytobackprop.png
Neural Net Library.csproj.user
Pattern.png
Thumbs.db
Neural Net Test
App.ico
bin
Debug
AdalineWordFile.dat
adalinewordWorkingFile.wrk
adword.trn
AxInterop.SHDocVw.dll
BackpropagationWorkingFile.wrk
Interop.SHDocVw.dll
Lin2Var.trn
LogViewer.dll
Neural Net Library.dll
Neural Net Test.exe
SelfOrganizingNetworkOne.trn
SelfOrganizingNetworkOne.wrk
SelfOrganizingNetworkOneTest.tst
SharpUtils.dll
Neural Net Test.csproj.user
NeuralNetTesterPackages.png
Pattern.png
SelfOrganizingNetworkDiagram.png
SelfOrganizingNetworkOneClasses.png
selfOrganizingnetworkoneoptions.png
SelfOrganizingNetworkTwoOptions.png
selforganizingnetworkword.png
Setting Options For a Given Network.png
SharpUtils
SharpUtils.csproj.user
Testing a Given Network.png
Thumbs.db
Train Network Interaction.png
Training a given Network.png
TransferEq.jpg
TransferFunctionlogic.jpg
Transferfunctionwithbias.jpg
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Neural_Net_Test
{
	/// <summary>
	/// Summary description for BackPropagationOneOptions.
	/// </summary>
	public class BackPropagationOneOptions : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.NumericUpDown numericNumberOfTests;
		private System.Windows.Forms.TextBox textBoxTolerance;
		private System.Windows.Forms.TextBox textBoxMomentum;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.TextBox textBoxLearningRate;
		private System.Windows.Forms.CheckBox checkBoxUseBias;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		private Icon icon;

		public BackPropagationOneOptions()
		{
			icon = new Icon( "App.ico" );
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.Icon = icon;

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		private int nNumberOfTests;
		private double dTolerance;
		private double dMomentum;
		private double dLearningRate;
		private bool bUseBias;

		public int NumberOfTests
		{
			get
			{
				return nNumberOfTests;
			}
			set
			{
				nNumberOfTests = value;
			}
		}

		public double Tolerance
		{
			get
			{
				return dTolerance;
			}
			set
			{
				dTolerance = value;
			}
		}

		public double Momentum
		{
			get
			{
				return dMomentum;
			}
			set
			{
				dMomentum = value;
			}
		}

		public double LearningRate
		{
			get
			{
				return dLearningRate;
			}
			set
			{
				dLearningRate = value;
			}
		}

		public bool UseBias
		{
			get
			{
				return bUseBias;
			}
			set
			{
				bUseBias = value;
			}
		}


		public BackPropagationOneOptions( int nNumberOfTests, double dTolerance, double dMomentum, double dLearningRate, bool bUseBias )
		{
			InitializeComponent();

			NumberOfTests = nNumberOfTests;
			numericNumberOfTests.Value = NumberOfTests;
			Tolerance = dTolerance;
			textBoxTolerance.Text = Tolerance.ToString();
			Momentum = dMomentum;
			textBoxMomentum.Text = Momentum.ToString();
			LearningRate = dLearningRate;
			textBoxLearningRate.Text = LearningRate.ToString();
			UseBias = bUseBias;
			checkBoxUseBias.Checked = UseBias;

		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BackPropagationOneOptions));
			this.label1 = new System.Windows.Forms.Label();
			this.numericNumberOfTests = new System.Windows.Forms.NumericUpDown();
			this.label2 = new System.Windows.Forms.Label();
			this.textBoxTolerance = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.textBoxMomentum = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.textBoxLearningRate = new System.Windows.Forms.TextBox();
			this.checkBoxUseBias = new System.Windows.Forms.CheckBox();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfTests)).BeginInit();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(112, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Number Of Tests";
			// 
			// numericNumberOfTests
			// 
			this.numericNumberOfTests.Location = new System.Drawing.Point(112, 24);
			this.numericNumberOfTests.Maximum = new System.Decimal(new int[] {
																				 250,
																				 0,
																				 0,
																				 0});
			this.numericNumberOfTests.Name = "numericNumberOfTests";
			this.numericNumberOfTests.TabIndex = 1;
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 56);
			this.label2.Name = "label2";
			this.label2.TabIndex = 2;
			this.label2.Text = "Tolerance";
			// 
			// textBoxTolerance
			// 
			this.textBoxTolerance.Location = new System.Drawing.Point(112, 56);
			this.textBoxTolerance.Name = "textBoxTolerance";
			this.textBoxTolerance.TabIndex = 3;
			this.textBoxTolerance.Text = "";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(8, 88);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(88, 23);
			this.label3.TabIndex = 4;
			this.label3.Text = "Momentum";
			// 
			// textBoxMomentum
			// 
			this.textBoxMomentum.Location = new System.Drawing.Point(112, 88);
			this.textBoxMomentum.Name = "textBoxMomentum";
			this.textBoxMomentum.TabIndex = 5;
			this.textBoxMomentum.Text = "textBox2";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(8, 120);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(88, 23);
			this.label4.TabIndex = 6;
			this.label4.Text = "Learning Rate";
			// 
			// textBoxLearningRate
			// 
			this.textBoxLearningRate.Location = new System.Drawing.Point(112, 120);
			this.textBoxLearningRate.Name = "textBoxLearningRate";
			this.textBoxLearningRate.TabIndex = 7;
			this.textBoxLearningRate.Text = "";
			// 
			// checkBoxUseBias
			// 
			this.checkBoxUseBias.Location = new System.Drawing.Point(112, 160);
			this.checkBoxUseBias.Name = "checkBoxUseBias";
			this.checkBoxUseBias.TabIndex = 8;
			this.checkBoxUseBias.Text = "Use Bias";
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(16, 224);
			this.button1.Name = "button1";
			this.button1.TabIndex = 9;
			this.button1.Text = "OK";
			this.button1.Click += new System.EventHandler(this.OnOK);
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(184, 224);
			this.button2.Name = "button2";
			this.button2.TabIndex = 10;
			this.button2.Text = "Cancel";
			this.button2.Click += new System.EventHandler(this.OnCancel);
			// 
			// BackPropagationOneOptions
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 266);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.button2,
																		  this.button1,
																		  this.checkBoxUseBias,
																		  this.textBoxLearningRate,
																		  this.label4,
																		  this.textBoxMomentum,
																		  this.label3,
																		  this.textBoxTolerance,
																		  this.label2,
																		  this.numericNumberOfTests,
																		  this.label1});

			this.Name = "BackPropagationOneOptions";
			this.Text = "BackPropagationOneOptions";
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfTests)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void OnOK(object sender, System.EventArgs e)
		{
			NumberOfTests = ( int )numericNumberOfTests.Value;
			double dTemp = 0.0;
			string strTemp = "";

			try
			{
				strTemp = textBoxTolerance.Text;
				dTemp = Double.Parse( strTemp );
				Tolerance = dTemp;
				strTemp = textBoxMomentum.Text;
				dTemp = Double.Parse( strTemp );
				Momentum = dTemp;
				strTemp = textBoxLearningRate.Text;
				dTemp = Double.Parse( strTemp );
				LearningRate = dTemp;

			}
			catch( ArgumentNullException argNullExp )
			{
				MessageBox.Show( "Error Argument Null Exception thrown by data entered, Please try again" + argNullExp.Message );
				return;
			}
			catch( FormatException formExp )
			{
				MessageBox.Show( "Error the data has to be in double format, you entered " + strTemp + formExp.Message );
				return;
			}
			catch( OverflowException overExp )
			{
				MessageBox.Show( "Error the number you entered is too large or too small " + overExp.Message );
				return;
			}

			this.Close();
		
		}

		private void OnCancel(object sender, System.EventArgs e)
		{
			this.Close();
		}
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

pseudonym67

United Kingdom United Kingdom
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 24 Oct 2003
Article Copyright 2003 by pseudonym67
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid