* * *

Author Topic: artificial neural networks | back propagation  (Read 3292 times)

cpalx

  • Hero Member
  • *****
  • Posts: 533
artificial neural networks | back propagation
« on: November 02, 2012, 01:32:58 pm »
is there any place where i can download the source code of a back propagation  artificial neural network? (Delphi or Lazarus)

Leledumbo

  • Hero Member
  • *****
  • Posts: 7624
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: artificial neural networks | back propagation
« Reply #1 on: November 02, 2012, 05:30:07 pm »
None that I know of (I implemented a part of it when I took the class a few years back, but I lost the code), however there's a Delphi binding for FANN.

schuler

  • New member
  • *
  • Posts: 11
Re: artificial neural networks | back propagation
« Reply #2 on: August 09, 2017, 11:13:26 pm »
 :) Hello  :)
Just to let you know that I've just implemented a backpropagation algorithm in Lazarus:

https://sourceforge.net/p/cai/svncode/HEAD/tree/trunk/lazarus/libs/ubackpropagation.pas

 :) Have fun :)

avra

  • Hero Member
  • *****
  • Posts: 1063
    • Additional info
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4248
Re: artificial neural networks | back propagation
« Reply #4 on: August 10, 2017, 10:29:24 am »
Try here: http://forum.lazarus.freepascal.org/index.php/topic,32620.msg210473.html#msg210473
Nope, you missed the point. That is actually very nice and concise code... Short is better than long. Playing with it..
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

avra

  • Hero Member
  • *****
  • Posts: 1063
    • Additional info
Re: artificial neural networks | back propagation
« Reply #5 on: August 10, 2017, 09:06:49 pm »
Try here: http://forum.lazarus.freepascal.org/index.php/topic,32620.msg210473.html#msg210473
Nope, you missed the point
Would you be so kind to explain why? I don't get it. What's wrong with this simple back propagation pascal code that you get after following the first link:
http://wayback.archive.org/web/20100926121015/http://richardbowles.tripod.com:80/neural/source/simple1.htm
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

schuler

  • New member
  • *
  • Posts: 11
Re: artificial neural networks | back propagation
« Reply #6 on: August 10, 2017, 09:52:50 pm »
 :) HELLO  :)

Just added a new constructor. It allows you to create a network with any size.

Code: Pascal  [Select]
  1. var
  2.   B: TBackPropagation;
  3. const
  4.   aNetworkSize: array[0..3] of integer = (3,1000,1000,3);
  5. begin
  6.   B := TBackPropagation.Create(aNetworkSize);
  7.  

The above means that you are creating a network with:
1 input layer with 3 nodes.
2 hidden layers with 1000 nodes each.
1 output layer with 3 nodes.

Just found that using "0.9" as output was saturating weights on networks with more than 10 layers. Using "0.1" seems to work well on these networks. The reason is the derivative function requiring high values when output is too close to 1 and -1.

Code: Pascal  [Select]
  1. const outputs : TBackInputOutput =
  2.   (// XOR, AND,   OR
  3.     (-0.1,-0.1,-0.1),
  4.     ( 0.1,-0.1, 0.1),
  5.     ( 0.1,-0.1, 0.1),
  6.     (-0.1, 0.1, 0.1)
  7.   );
  8.  

My next step is: I'll create a class specific for data classification extending the backpropagation class.

 :) Have Fun :)

Leledumbo

  • Hero Member
  • *****
  • Posts: 7624
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: artificial neural networks | back propagation
« Reply #7 on: August 12, 2017, 01:01:54 am »
:) Hello  :)
Just to let you know that I've just implemented a backpropagation algorithm in Lazarus:

https://sourceforge.net/p/cai/svncode/HEAD/tree/trunk/lazarus/libs/ubackpropagation.pas

 :) Have fun :)
Ah... if only you made it 7 years earlier, I might get an A from that class :P

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus