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 SharpUtils;
using System.Collections;
using System.Text;
using System.Xml.Serialization;
using System.Xml;

namespace Neural_Net_Library
{


	/// <summary>
	/// Back Propagation Word pattern class 
	/// </summary>
	public class BackPropagationWordPattern : AdalineWordPattern
	{

		private DebugLevel debugLevel;
		private Logger log;

		/// <summary>
		/// constructor
		/// </summary>
		public BackPropagationWordPattern( Logger log ) : base( log )
		{
			debugLevel = new DebugLevel( DebugLevel.currentLevel );
			this.log = log;

		}

		/// <summary>
		/// constructor taking the input and the output sizes
		/// </summary>
		/// <param name="nInSize"></param>
		/// <param name="nOutSize"></param>
		public BackPropagationWordPattern( Logger log, int nInSize, int nOutSize ) : base( log, nInSize, nOutSize )
		{
			debugLevel = new DebugLevel( DebugLevel.currentLevel );
			this.log = log;

		}

		public BackPropagationWordPattern( Logger log, string strOne, string strTwo, double dOutput ) : base( log )
		{
			debugLevel = new DebugLevel( DebugLevel.currentLevel );
			this.log = log;

			this.InSet.Add( strOne );
			this.InSet.Add( strTwo );
			this.OutSet.Add( dOutput );

		}


		public BackPropagationWordPattern( Logger log, ArrayList arrayInSet, ArrayList arrayOutSet ) : base( log, arrayInSet, arrayOutSet )
		{
			debugLevel = new DebugLevel( DebugLevel.currentLevel );
			this.log = log;
		}

		public new double GetInSetAt( int nID )
		{
			/// calculate the value for the string

			if( nID >= this.InSet.Count )
			{
				if( debugLevel.TestDebugLevel( DebugLevelSet.WarningsAndErrors ) == true )
				{
					log.Log( DebugLevelSet.WarningsAndErrors, "Warning the value passed to back propagation word GetInSetAt, access value is greater than array count, accessor = " + nID.ToString(), ClassName );  
				}

				return 0.0;
			}
			
			double dValue = 0;
			string strTemp = this.InSet[ nID ].ToString();
			for( int i=0; i<strTemp.Length; i++ )
			{
				dValue += strTemp[ i ] * ( i+1 );
			}

			StringBuilder strBuilder = new StringBuilder();
			
			/// move decimal place
			dValue = dValue / 100000;

			if( dValue < 0 )
			{
				StringBuilder strTempNum = new StringBuilder( dValue.ToString() );
				strTempNum.Remove( 0, 1 );
				strBuilder.Append( strTempNum );
				strBuilder.Insert( 0, '-' );
			}
			else
			{
				strBuilder.Append( dValue.ToString() );
			}

			return Double.Parse( strBuilder.ToString() );
		}


		public new string Data()
		{
			StringBuilder strString = new StringBuilder();
			strString.Append( "Pattern ID = " + this.PatternID.ToString() );
			for( int n=0; n<this.InputSize(); n++ )
				strString.Append(  this.InSet[ n ].ToString() + " " );

			return strString.ToString();
		}

		public new string ClassName
		{
			get
			{
				return this.ToString();
			}
		}

	}
	
}

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