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

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 SelfOrganizingNetworkOneOptions.
	/// </summary>
	public class SelfOrganizingNetworkOneOptions : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.NumericUpDown numericNumberOfItems;
		private System.Windows.Forms.TextBox textInitialLearningRate;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.NumericUpDown numericNumberOfIterations;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.TextBox textFinalLearningRate;
		private System.Windows.Forms.NumericUpDown numericNeighborhoodSize;
		private System.Windows.Forms.NumericUpDown numericNeighborhoodDecrementInterval;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;


		private int nNumberOfItems;
		private double dInitialLearningRate;
		private double dFinalLearningRate;
		private int nInitialNeighborhoodSize;
		private int nNeighborhoodDecrementInterval;
		private int nNumberOfIterations;

		public int NumberOfItems
		{
			get
			{
				return nNumberOfItems;
			}
			set
			{
				nNumberOfItems = value;
			}
		}

		public double InitialLearningRate
		{
			get
			{
				return dInitialLearningRate;
			}
			set
			{
				dInitialLearningRate = value;
			}
		}

		public double FinalLearningRate
		{
			get
			{
				return dFinalLearningRate;
			}
			set
			{
				dFinalLearningRate = value;
			}
		}

		public int InitialNeighborhoodSize
		{
			get
			{
				return nInitialNeighborhoodSize;
			}
			set
			{
				nInitialNeighborhoodSize = value;
			}
		}

		public int NeighborhoodDecrementInterval
		{
			get
			{
				return nNeighborhoodDecrementInterval;
			}
			set
			{
				nNeighborhoodDecrementInterval = value;
			}
		}

		public int NumberOfIterations
		{
			get
			{
				return nNumberOfIterations;
			}
			set
			{
				nNumberOfIterations = value;
			}
		}

		public SelfOrganizingNetworkOneOptions( int nNumberOfItems, double dInitialLearningRate, double dFinalLearningRate, int nNeighborhoodSize, int nNeighborhoodDecrementInterval, int nNumberOfIterations )
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

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

			NumberOfItems = nNumberOfItems;
			InitialLearningRate = dInitialLearningRate;
			FinalLearningRate = dFinalLearningRate;
			InitialNeighborhoodSize = nNeighborhoodSize;
			NeighborhoodDecrementInterval = nNeighborhoodDecrementInterval;
			NumberOfIterations = nNumberOfIterations;

			numericNumberOfItems.Value = NumberOfItems;
			textInitialLearningRate.Text = InitialLearningRate.ToString();
			textFinalLearningRate.Text = FinalLearningRate.ToString();
			numericNeighborhoodSize.Value = InitialNeighborhoodSize;
			numericNeighborhoodDecrementInterval.Value = NeighborhoodDecrementInterval;
			numericNumberOfIterations.Value = NumberOfIterations;



		}

		/// <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(SelfOrganizingNetworkOneOptions));
			this.label1 = new System.Windows.Forms.Label();
			this.numericNumberOfItems = new System.Windows.Forms.NumericUpDown();
			this.label2 = new System.Windows.Forms.Label();
			this.textInitialLearningRate = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.numericNumberOfIterations = new System.Windows.Forms.NumericUpDown();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.textFinalLearningRate = new System.Windows.Forms.TextBox();
			this.numericNeighborhoodSize = new System.Windows.Forms.NumericUpDown();
			this.numericNeighborhoodDecrementInterval = new System.Windows.Forms.NumericUpDown();
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfItems)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfIterations)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNeighborhoodSize)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNeighborhoodDecrementInterval)).BeginInit();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 16);
			this.label1.Name = "label1";
			this.label1.TabIndex = 0;
			this.label1.Text = "Number Of Items";
			// 
			// numericNumberOfItems
			// 
			this.numericNumberOfItems.Location = new System.Drawing.Point(152, 16);
			this.numericNumberOfItems.Maximum = new System.Decimal(new int[] {
																				 1000,
																				 0,
																				 0,
																				 0});
			this.numericNumberOfItems.Name = "numericNumberOfItems";
			this.numericNumberOfItems.TabIndex = 1;
			this.numericNumberOfItems.Value = new System.Decimal(new int[] {
																			   300,
																			   0,
																			   0,
																			   0});
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(8, 48);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(120, 23);
			this.label2.TabIndex = 2;
			this.label2.Text = "Initial Learning Rate";
			// 
			// textInitialLearningRate
			// 
			this.textInitialLearningRate.Location = new System.Drawing.Point(152, 48);
			this.textInitialLearningRate.Name = "textInitialLearningRate";
			this.textInitialLearningRate.TabIndex = 3;
			this.textInitialLearningRate.Text = "textBox1";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(8, 80);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(128, 23);
			this.label3.TabIndex = 4;
			this.label3.Text = "Final Learning Rate";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(8, 112);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(128, 23);
			this.label4.TabIndex = 6;
			this.label4.Text = "Neighborhood Size";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(8, 144);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(136, 23);
			this.label5.TabIndex = 8;
			this.label5.Text = "Neighborhood Decrement";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(8, 176);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(120, 23);
			this.label6.TabIndex = 10;
			this.label6.Text = "Number Of Iterations";
			// 
			// numericNumberOfIterations
			// 
			this.numericNumberOfIterations.Location = new System.Drawing.Point(152, 176);
			this.numericNumberOfIterations.Maximum = new System.Decimal(new int[] {
																					  1000,
																					  0,
																					  0,
																					  0});
			this.numericNumberOfIterations.Name = "numericNumberOfIterations";
			this.numericNumberOfIterations.TabIndex = 11;
			this.numericNumberOfIterations.Value = new System.Decimal(new int[] {
																					500,
																					0,
																					0,
																					0});
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(32, 224);
			this.button1.Name = "button1";
			this.button1.TabIndex = 12;
			this.button1.Text = "O.K.";
			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 = 13;
			this.button2.Text = "Cancel";
			this.button2.Click += new System.EventHandler(this.OnCancel);
			// 
			// textFinalLearningRate
			// 
			this.textFinalLearningRate.Location = new System.Drawing.Point(152, 80);
			this.textFinalLearningRate.Name = "textFinalLearningRate";
			this.textFinalLearningRate.TabIndex = 14;
			this.textFinalLearningRate.Text = "textB";
			// 
			// numericNeighborhoodSize
			// 
			this.numericNeighborhoodSize.Location = new System.Drawing.Point(152, 112);
			this.numericNeighborhoodSize.Name = "numericNeighborhoodSize";
			this.numericNeighborhoodSize.TabIndex = 15;
			this.numericNeighborhoodSize.Value = new System.Decimal(new int[] {
																				  5,
																				  0,
																				  0,
																				  0});
			// 
			// numericNeighborhoodDecrementInterval
			// 
			this.numericNeighborhoodDecrementInterval.Location = new System.Drawing.Point(152, 144);
			this.numericNeighborhoodDecrementInterval.Maximum = new System.Decimal(new int[] {
																								 2000,
																								 0,
																								 0,
																								 0});
			this.numericNeighborhoodDecrementInterval.Name = "numericNeighborhoodDecrementInterval";
			this.numericNeighborhoodDecrementInterval.TabIndex = 16;
			this.numericNeighborhoodDecrementInterval.Value = new System.Decimal(new int[] {
																							   1000,
																							   0,
																							   0,
																							   0});
			// 
			// SelfOrganizingNetworkOneOptions
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(320, 266);
			this.Controls.Add(this.numericNeighborhoodDecrementInterval);
			this.Controls.Add(this.numericNeighborhoodSize);
			this.Controls.Add(this.textFinalLearningRate);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.numericNumberOfIterations);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.textInitialLearningRate);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.numericNumberOfItems);
			this.Controls.Add(this.label1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "SelfOrganizingNetworkOneOptions";
			this.Text = "SelfOrganizingNetworkOneOptions";
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfItems)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNumberOfIterations)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNeighborhoodSize)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.numericNeighborhoodDecrementInterval)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

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

			try
			{
				strTemp = textInitialLearningRate.Text;
				dTemp = Double.Parse( strTemp );
				InitialLearningRate = dTemp;
				strTemp = textFinalLearningRate.Text;
				dTemp = Double.Parse( strTemp );
				FinalLearningRate = dTemp;

				NumberOfIterations = ( int )this.numericNumberOfIterations.Value;
				NumberOfItems = ( int )this.numericNumberOfItems.Value;
				InitialNeighborhoodSize = ( int )this.numericNeighborhoodSize.Value;
				NeighborhoodDecrementInterval = ( int )this.numericNeighborhoodDecrementInterval.Value;

			}
			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
Web02 | 2.8.141029.1 | Last Updated 24 Oct 2003
Article Copyright 2003 by pseudonym67
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid