Bo Palmblad

Author Homepage: http://www.swcab.nu

Send e-mail to this Author

  • VCL, FMX, LCL, FNC, .NET, IntraWeb component development
  • Windows, Web, Android, iOS, macOS, Linux, Node.js development projects
  • Training, consulting & custom project development

TMS software has a team of experienced developers with main office in Europe, Belgium as well as offices in Germany, Uruguay & Brazil.

Author Products

Total 1 product

ANN NEURONs made simple v.1.0

Components > Component Packs > Other

By Bo Palmblad.

Commercial 22 Oct 2018

Description

DEMO TRAINING PATTERN OF THE PROPAGATION NEURON [ANN:4-3-4 ] Training session ---------------------- The inputs from the pattern file 1.00 1.00 0.00 0.00 The outputs we want from the pattern 1.00 0.00 0.00 0.00 The inputs from the pattern file 0.00 0.00 1.00 1.00 The outputs we want from the pattern 0.00 0.00 0.00 1.00 The inputs from the pattern file 1.00 0.00 1.00 0.00 The outputs we want from the pattern 0.00 0.00 1.00 0.00 The inputs from the pattern file 0.00 1.00 0.00 1.00 The outputs we want from the pattern 0.00 1.00 0.00 0.00 The inputs from the pattern file 1.00 1.00 0.00 1.00 The outputs we want from the pattern 1.00 0.00 0.00 0.00 The inputs from the pattern file 0.00 0.00 0.00 0.00 The outputs we want from the pattern 0.00 0.00 0.00 0.00 [ANN:4-3-4] answer to queries ======================== Testing network inputs (4) values Input of the network is: 0.00 0.00 1.00 0.00 Output of the network is: 0.00 0.00 0.02 0.97 Global error calculus 0.00075 --------------------------------------------------------------------- Propagation NEURON object --------------------------------------------------------------------- Inizialising NEURON OBJECT. Input of the network is : 0.00 0.00 1.00 0.00 Output of the obj net is: 0.00 0.00 0.07 0.93 No of cycles computed 2000 No of iterations computed 15 Global error calculus 0.00049 OBJECT NEURON is unloaded from memory. DEBUG Training time: 2000 * 15 iterations * 6 patterns is 181 ms RELEASE Training time: 2000 * 15 iterations * 6 patterns is 128 ms Query time 0 ms --------------------------------------------------------------------- Testing network inputs (4) values Input of the network is: 1.00 1.00 0.00 0.00 Output of the network is: 0.99 0.00 0.00 0.00 Global error calculus 0.00075 --------------------------------------------------------------------- Propagation NEURON object --------------------------------------------------------------------- Inizialising NEURON OBJECT. Input of the network is : 1.00 1.00 0.00 0.00 Output of the obj net is: 0.99 0.00 0.00 0.00 No of cycles computed 2000 No of iterations computed 15 Global error calculus 0.00049 OBJECT NEURON is unloaded from memory. DEBUG Training time: 2000 * 15 iterations * 6 patterns is 176 ms RELEASE Training time: 2000 * 15 iterations * 6 patterns is 119 ms Query time 0 ms --------------------------------------------------------------------- To my surprise the 32-bit code was always faster than 64-bit. Demo code how to setup and run the NEURON ======================================== Neuron:=TPropagationNeuron.Create(Nil); // Create the NEURON. Neuron.ANNSetIHOsize(4,3,4); // 4 inp 3 hidden 4 outputs if Neuron.ANNInitPatterns('PATTERNS.txt') then // Actually setup the PATTERNS.TXT Begin Neuron.ANNSetCycles:=2000; // Number of cycles to run training Neuron.ANNSetIterations:=15; // Number of itterations / training cycle Neuron.ANNTraining; // Actually TRAIN the neuron Val(Edit1.Text, v, e); Neuron.ANNSetInput(1,v); // Setup Input grid value 1 with value v Val(Edit2.Text, v, e); Neuron.ANNSetInput(2,v); // Setup Input grid value 2 with value v Val(Edit3.Text, v, e); Neuron.ANNSetInput(3,v); // Setup Input grid value 3 with value v Val(Edit4.Text, v, e); Neuron.ANNSetInput(4,v); // Setup Input grid value 4 with value v Neuron.ANNTestData; // ACTUALLY DO THE ANALYSIS . Tyt:=' '; for i:=1 to 4 do Begin Str(Neuron.ANNGetOutput(i):5:2, Txt); // Get the answers from the Outputs of the NEURON Tyt:=Tyt+Txt; End; Form1.Memo1.Lines.Add(' Input of the network is :'+Inp); // Present input pattern Form1.Memo1.Lines.Add('Output of the obj net is:'+Tyt); // Present answer Str(Neuron.ANNGetCycles, Txt); // Aquire no of cycles training has been done Form1.Memo1.Lines.Add('No of cycles computed '+Txt); // SHOW result Str(Neuron.ANNGetIterations, Txt); // Aquire no of itterations Form1.Memo1.Lines.Add('No of iterations computed '+Txt); // SHOW result Str(Neuron.ANNGlobalError:5:5, Txt); // Aquire the Global error Form1.Memo1.Lines.Add('Global error calculus '+Txt); // SHOW result End; Neuron.ANNClose; // Shut down structure Neuron.Free; // Free computer memory from NEURON DEMO PATTERNS FROM FILE NEURON is [ANN:4-3-4] ======================== 6 Number of patterns to handle 1 1 0 0 1 0 0 0 4 inputs 4 result we want 0 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 4 inputs 4 result we want ( rubbish collection ) don't forget. as is on disc "PATTERNS.TXT" 6 1 1 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 "DELPHI 10.2.3 Tokyo" values PropagationNeuron.dcu is 21Kbyte in size compiled I-H-O Sourcecode is 12Kbyte. "DELPHI 10.2.3 Tokyo" values PropagationNeuron2.dcu is 22Kbyte in size compiled I-H-H-O Sourcecode is 13Kbyte. Same functionallity of both versions, based on same code, simply expanded to 2 hidden layers. Pure PASCAL no added units, no restrictions compile in any compiler from D7 and forward. All tests development and compillations made in DELPHI 10.2.3 Tokyo Testcompiled clean in DELPHI 10 Seattle Object "PropagationNeuron" testcompiled clean in Delphi7, test enviroment code available if you want it. Edit1..4 for input ch 1,2,3,4 Memo1 to report results and a Button, that is it. -------------------------------------------------------------------------------------------------------------------------------------------- unit NUnit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, PropagationNeuron; type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; procedure Button1Click(Sender: TObject); procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; Neuron : TPropagationNeuron; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); Var v : Real; i,e : Integer; Txt, Tyt, Inp : String; begin Inp:=Edit1.Text+' '+Edit2.Text+' '+Edit3.Text+' '+Edit4.Text; Neuron:=TPropagationNeuron.Create(Nil); Neuron.ANNSetIHOsize(4,3,4); if Neuron.ANNInitPatterns('PATTERNS.txt') then Begin Neuron.ANNSetCycles:=2000; Neuron.ANNSetIterations:=15; Neuron.ANNTraining; Val(Edit1.Text, v, e); Neuron.ANNSetInput(1,v); Val(Edit2.Text, v, e); Neuron.ANNSetInput(2,v); Val(Edit3.Text, v, e); Neuron.ANNSetInput(3,v); Val(Edit4.Text, v, e); Neuron.ANNSetInput(4,v); Neuron.ANNTestData; Tyt:=' '; for i:=1 to 4 do Begin Str(Neuron.ANNGetOutput(i):5:2, Txt); Tyt:=Tyt+Txt; End; Form1.Memo1.Lines.Add(' Input of the network is :'+Inp); Form1.Memo1.Lines.Add('Output of the obj net is:'+Tyt); Str(Neuron.ANNGetCycles, Txt); Form1.Memo1.Lines.Add('No of cycles computed '+Txt); Str(Neuron.ANNGetIterations, Txt); Form1.Memo1.Lines.Add('No of iterations computed '+Txt); Str(Neuron.ANNGlobalError:5:5, Txt); Form1.Memo1.Lines.Add('Global error calculus '+Txt); End; //Neuron.ANNSaveNeuralCore('N2.core'); Neuron.ANNClose; Neuron.Free; end; procedure TForm1.FormShow(Sender: TObject); begin Edit1.Text:='0'; Edit2.Text:='0'; Edit3.Text:='1'; Edit4.Text:='0'; end; -------------------------------------------------------------------------------------------------------------------------------------------- OBS. All versions used same TPropagationNeuron code, only enviroment was rewritten for D7. OBS.

Informations

  • Status: Fully functional
  • Source: On purchase/registration
  • Source price: $25
  • Exe demo: included
  • Size: 661kB

Platforms: D7, DX, DXE, DXE2, DXE3, DXE4, DXE5, DXE6, DXE64, DXE7, DXE8


More interesting links and pages



Discover UK licensed casino sites at Casinopilot


Check out Valforex reviews


Scrummaster and Agile trainings


Word Unscrambler


Check the best online casinos in UK


What is control panel?


China Wholesale Suppliers Directory


Free Angram Solver


Syllable Word Counter


Printable Sudoku Puzzles


Download Instagram Stories


Word Search Puzzles


Try out new casino sites at SmartphoneCasinos.co.uk