Pascal下的 BackPropagation 算法
在Free Pascal 2.0.0 下编译通过编的是Machine Learning上的样例:8x3x8,也是我在TI上编的电脑就是快啊!10000次训练眼睛都不用怎么眨~uses sysutils;const nin=8; nhid=3; nout=8; rate=0.1; var t,p,q,r,v,tt,tc:longint; l1:array[1..nin,1..nhid]of real; l2:array[1..nhid,1..nout]of real; i:array[1..nin]of longint; eo,o,ot:array[1..nout]of real; h,eh:array[1..nhid]of real; s1,s2:string; te:real; function sigmod(x:real):real;begin exit(1/(1+exp(-x)));end; begin if fileexists(‘bpnet.dat’) then begin writeln(‘Reading Network Data:’); assign(input,’bpnet.dat’); reset(input); for t:=1 to nin do for p:=1 to nhid do read(l1[t,p]); for t:=1 to nhid do for p:=1 …