Post by windfire on Aug 1, 2023 16:04:07 GMT
using [TstPatterns] as the training set and [Patterns] as the learned set.
The weight update is working.But how do I exstract the weights and the correct output logics?
I don't understand how this learns.Here's what I wrote.
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' Top Of Page
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Pi=atn(1)*4:Pi2=(Pi*2):Mdeg=(180/Pi):Mrdn=(Pi/180)
global Pi,Pi2,Mdeg,Mrdn,BWH2$
gosub [GetDTAS]
gosub [Dsp1]
'goto [Norm]
'
restore [TstPatterns]
read A$
Ptrn$(1)=A$
read A$
Ptrn$(2)=A$
read A$
Ptrn$(3)=A$
read A$
Ptrn$(4)=A$
read A$
Ptrn$(5)=A$
read A$
Ptrn$(6)=A$
read A$
Ptrn$(7)=A$
read A$
Ptrn$(8)=A$
read A$
Ptrn$(9)=A$
Pxlmt=9
goto [PtrJup]
'
[Norm]
restore [Patterns]
read A$
Ptrn$(1)=A$
read A$
Ptrn$(2)=A$
read A$
Ptrn$(3)=A$
read A$
Ptrn$(4)=A$
Pxlmt=4
[PtrJup]
AccuIntr=0:Capcorrect$="":pttrn=0
Sum=0
[Ptrn]
scan
pttrn=pttrn+1
PX=PX+1
X1$=Ptrn$(PX)
print "~~~~~~~~~~~~~~~ Patern ~~~~~~~~~~~~~~~~~ ";PX
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for Intr =1 to 75
scan
print " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ";Intr
AccuIntr=AccuIntr+Intr:ICnt=ICnt+1
gosub [Dsp1]
X2$=""
'
for AodWt=1 to NhWt
bias=val(word$(Hdnbis$,AodWt))
if AodWt=2 then WH$=WH2$
Fedset=0':FSum=0
[Feed]
Fedset=Fedset+1
''print word$(X1$,Fedset);" ";word$(WH$,Fedset)
x=val(word$(X1$,Fedset)):w=val(word$(WH$,Fedset))
FSum=FSum+(x*w)
if Fedset<Lng(X1$) then [Feed]
BisSum$=str$(FSum+bias)
Call Sigmoid$ Sigmoid$,BisSum$
Op1$=Sigmoid$
X2$=X2$;Op1$;" "
'print " Op1$ ";Op1$
Op$=Op1$:CarryOp$=Op$
next AodWt
'
'print " X2$ ";X2$
WH$=OWt$:wSum=0
bias=val(word$(Obais$,1))
for x2=1 to Lng(X2$)
x=val(word$(X2$,x2)):w=val(word$(WH$,x2))
wSum=wSum+(x*w)
next x2
BisSum$=str$(wSum+bias)
Call Sigmoid$ Sigmoid$,BisSum$
'print "~~~~~~~~~~~~ Op1$ ";Op1$
Op1$=Sigmoid$
Op$=Op1$':OpExspect$=str$(1)
print tab(16);Op$;" ";X1$
gosub [CallError]
if val(Error$)<1e-15 then gosub [Correct.Logic$]
'
gosub [CallOpt.Optbias]
OldOpt$=Optbias$
CapOperr$=Optbias$;" "
for bc=1 to Lng(X2$)
GvnOpt$=word$(X2$,bc):GvnWt$=word$(OWt$,bc)
gosub [CallHdnOptbias$]
CapOperr$=CapOperr$;Hdn.Optbias$;" "
next bc
'print CapOperr$
gosub [WtAdjust]
OptErrbias$=word$(CapErrOp$,1):OldOpt$=word$(ExOldOp$,1)
gosub [CallWtDff]
aOtOldWt$=word$(ExOldOp$,1)
gosub [CallWtNew]
CapW$=NewWt$;" "
Obais$=NewWt$
Hdnbis$=""
for Bud=1 to Lng(X2$)
OptErrbias$=word$(CapErrOp$,1+Bud):OldOpt$=word$(ExOldOp$,1+Bud)
gosub [CallWtDff]
aOtOldWt$=word$(ExOldOp$,1+Bud)
gosub [CallWtNew]
CapW$=CapW$;NewWt$;" "
Hdnbis$=Hdnbis$;NewWt$
next Bud
'print " CapW$ ";CapW$
'print " Obais$ ";Obais$
'print " Hdnbis$ ";Hdnbis$
' WH$=""
' for xj=1 to 2
' if xj>1 then WH2$=""
' for xq=1 to Lng(X1$)
' xc=xc+1
' if xj=1 then WH$=WH$;word$(CapWt$,xc);" "
' if xj>1 then WH2$=WH2$;word$(CapWt$,xc);" "
' next xq
' next xj
' print " WH$ ";WH$
' print " WH2$ ";WH2$
next Intr
[PttrnExit]
if PX=Pxlmt then [SysExit]
if PX<Pxlmt then [Ptrn]
[SysExit]
print WH$
print WH2$
print " Capcorrect$ ";Capcorrect$
print "Fit is ";((ICnt/AccuIntr)/0.83333333)
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[quit]
end
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[WtAdjust]
CapErrOp$="0.1311 -0.0087 -0.0065"
'print " X2$ ";X2$
Prv$="";Prv2$=""
'XXX???
'XXX???
for Oeo=1 to Lng(X1$)
for Geo=1 to Lng(X2$)
xj=xj+1
Optbias$=word$(CapOperr$,Geo)
HdnOp$=word$(X1$,Oeo)
'print " CapErrOp$ ";CapErrOp$
if Geo=1 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH$,Oeo)':print tab(14);" OldErrOpt$ ";OldErrOpt$
if Geo=2 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH2$,Oeo)':print tab(18);" OldErrOpt$ Gvn ";OldErrOpt$
'print " Optbias$ ";Optbias$
'print xj,Wtbias$,OldErrOpt$,HdnOp$
'
OptErrbias$=OldErrOpt$:OldOpt$=HdnOp$
'print "~~~~~~~~~~ OldErrOpt$ ";OldErrOpt$;" OldOpt$ ";OldOpt$
'OptErrbias$=OldErrOpt$
gosub [CallWtDff]
'
aOtOldWt$=Wtbias$ ' DffWt$
gosub [CallWtNew]
CapWt$=CapWt$;NewWt$;" "
next Geo
'
next Oeo
' CapWt$=CapWt$;"__"
'print " CapWt$ ";CapWt$
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Correct.Logic$]
if Error$<=str$(1e-15) then 'str$(0.2261111)
' if val(Op$)<>1 then
' Capcorrect$=Capcorrect$;Op$;" "
' print tab(36);" Activated ";" Op$ ";CarryOp$
if (0+instr(rdCorrect$,Op$))=0 then
gosub [PerGs]
print tab(50);" FIRE "
end if
' end if
' if val(CarryOp$)>0.98984 then
' Target$=str$((val(OpExspect$)*val(CarryOp$)))
'print tab(36);Target$
'if val(Target$)>0.922 then
gosub [SecDsply]
goto [PttrnExit]
' end if
' end if
end if
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'
Function Lng(byref Stream$)
[loop]
q=q+1
Ck$=word$(Stream$,q)
if Ck$<>"" then [loop]
Lng=q-1
end function
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'Call Sigmoid$ Sigmoid$,Sum$
Sub Sigmoid$ byref Unk1$,byref Unk2$
Unk1$=str$(1/(1+exp(val(Unk2$)*-1)))
end sub
[Sig]
Call Sigmoid$ Sigmoid$,Sum$
return
'
Sub Error$ byref Unk3$,byref Unk1$,byref Unk2$
Unk3$=str$(val(Unk2$)-val(Unk1$))
end sub
[CallError]
Call Error$ Error$,Op$,OpExspect$
'print tab(36);" Error$ ";Error$
return
'
Sub Optbias$ byref Unk3$,byref Unk1$,byref Unk2$
''print " ";Unk1$,Unk2$
Unk3$=str$(val(Unk1$)*(1-val(Unk1$))*(val(Unk2$)-val(Unk1$)))
end sub
[CallOpt.Optbias]
Call Optbias$ Optbias$,Op$,OpExspect$
'print " Opt.Optbias$ ";Optbias$
return
'
Sub Hdn.Optbias$ byref Unk5$,byref Unk1$,byref Unk2$,byref Unk3$,byref Unk4$
Unk5$=str$(val(Unk1$)*(1-val(Unk1$))*(val(Unk2$))*val(Unk3$))
end sub
[CallHdnOptbias$]
'print GvnOpt$,GvnWt$,OldOpt$
Call Hdn.Optbias$ Hdn.Optbias$,GvnOpt$,GvnWt$,OldOpt$,Optbias$
'print " Hdn.Optbias$ ";Hdn.Optbias$
return
'
Sub DffWt$ byref Unk4$,byref Unk1$,byref Unk2$,byref Unk3$
Unk4$=str$(val(Unk1$)*(val(Unk2$)*val(Unk3$)))'*(1/(val(Error$)^2)))
end sub
[CallWtDff]
'print OptErrbias$,OldOpt$
call DffWt$ DffWt$,Lr$,OptErrbias$,OldOpt$
'print " DffWt$ ";DffWt$
return
'
Sub NewWt$ byref Unk3$,byref Unk1$,byref Unk2$
Unk3$=str$(val(Unk1$)+val(Unk2$))
end sub
'
[CallWtNew]
call NewWt$ NewWt$,DffWt$,aOtOldWt$
'print " NewWt$ ";NewWt$
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Input11]
'X1$ WH1$ WH2$ OWt$ OBias$ Hdnbias$
'Data "1 0 1","0.2 0.4 -0.5","-0.3 0.1 0.2","-0.3 -0.2","0.1","-0.4 0.2"
Data "0.3845e-3 0.475e-2 0.8424 0.58342e-2 0.4725 0.93264e-1","0.2e-3 0.4e-5 -0.5 -0.2 0.3e-7 -0.1","-0.3 0.1e-4 0.2 0.2e-7 -0.4e-5 -0.2","-0.3 -0.2","0.1","-0.4 0.2"
[Patterns]
Data "1 0 1 1 1 0","0 1 1 0 1 0","1 1 0 1 1 0","1 0 0 1 1 0"
'
[TstPatterns]
' 1XX 2XX 3* 4XX 5* 6XX 7* 8XX 9*
Data "1 1 1 1 1 0","1 0 1 0 0 1","1 0 1 1 1 0","1 0 0 1 0 0","0 1 1 0 1 0","1 1 1 0 1 0","1 1 0 1 1 0","1 1 0 1 1 1","1 0 0 1 1 0"
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[GetDTAS]
'read X1$
' read WH$
' read WH2$
' WH$="-3.94380628 3.41242576 5.86352165 -2.84657561 1.9467552 -1.45021985"
' WH2$="-1.10650034 1.89783797 3.69891394 2.07168245 0.65237251 5.44987989"
read OWt$
read Obais$
read Hdnbis$
BWH$=WH$
BWH2$=WH2$
ExOldOp$="209 1.994 -0.416"
NhWt=2:OpExspect$=word$(rdCorrect$,pttrn):Lr$=str$(0.9)
return
[Dsp1]
WH$="":WH2$=""
'print X1$
' 'print WH$
' 'print WH2$
for wq=1 to 2
for wj=1 to Lng(X1$)
if wq=1 then WH$=WH$;str$((rnd(0.5)+1e-22)*1e1-4);" "
if wq>1 then WH2$=WH2$;str$((rnd(0.5)+1e-22)*1e1-3);" "
next wj
next wq
WH$="5.48135759 1.44427372 5.82318889 5.1547191 6.26680216 -2.68556499"
WH2$="1.04304859 2.75476629 -0.10393762 0.56375753 -2.93664628 2.96154259"
' 1 2 3 4 5 6 7 8 9
' rdCorrect$="0.50123786 0.50128872 0.50133277 0.50046735 0.50124773 0.50131421 0.50124041 0.50017406 0.5013336"
rdCorrect$="0.50133362 0.50133362 0.50133362 0.5013336"
' 5---4
' 5---4
print WH$
print WH2$
'print OWt$
'print Obais$
'print Hdnbis$
return
[SecDsply]
'print
'print X1$
'print "###### ";WH$
'print "###### ";WH2$
'print OWt$
'print Obais$
'print Hdnbis$
return
[PerGs]
CapErrOp$="0.1311 -0.0087 -0.0065"
'print " X2$ ";X2$
Prv$="";Prv2$=""
'XXX???
'XXX???
for Oeo=1 to Lng(X1$)
for Geo=1 to Lng(X2$)
xj=xj+1
Optbias$=word$(CapOperr$,Geo)
HdnOp$=word$(X1$,Oeo)
'print " CapErrOp$ ";CapErrOp$
if Geo=1 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH$,Oeo)':print tab(14);" OldErrOpt$ ";OldErrOpt$
if Geo=2 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH2$,Oeo)':print tab(18);" OldErrOpt$ Gvn ";OldErrOpt$
'print " Optbias$ ";Optbias$
'print xj,Wtbias$,OldErrOpt$,HdnOp$
'
OptErrbias$=OldErrOpt$:OldOpt$=HdnOp$
'print "~~~~~~~~~~ OldErrOpt$ ";OldErrOpt$;" OldOpt$ ";OldOpt$
'OptErrbias$=OldErrOpt$
gosub [CallWtDff]
'
aOtOldWt$=Wtbias$ ' DffWt$
gosub [CallWtNew]
CapWt$=CapWt$;NewWt$;" "
next Geo
'
next Oeo
' CapWt$=CapWt$;"__"
'print " CapWt$ ";CapWt$
return
The weight update is working.But how do I exstract the weights and the correct output logics?
I don't understand how this learns.Here's what I wrote.
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' Top Of Page
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Pi=atn(1)*4:Pi2=(Pi*2):Mdeg=(180/Pi):Mrdn=(Pi/180)
global Pi,Pi2,Mdeg,Mrdn,BWH2$
gosub [GetDTAS]
gosub [Dsp1]
'goto [Norm]
'
restore [TstPatterns]
read A$
Ptrn$(1)=A$
read A$
Ptrn$(2)=A$
read A$
Ptrn$(3)=A$
read A$
Ptrn$(4)=A$
read A$
Ptrn$(5)=A$
read A$
Ptrn$(6)=A$
read A$
Ptrn$(7)=A$
read A$
Ptrn$(8)=A$
read A$
Ptrn$(9)=A$
Pxlmt=9
goto [PtrJup]
'
[Norm]
restore [Patterns]
read A$
Ptrn$(1)=A$
read A$
Ptrn$(2)=A$
read A$
Ptrn$(3)=A$
read A$
Ptrn$(4)=A$
Pxlmt=4
[PtrJup]
AccuIntr=0:Capcorrect$="":pttrn=0
Sum=0
[Ptrn]
scan
pttrn=pttrn+1
PX=PX+1
X1$=Ptrn$(PX)
print "~~~~~~~~~~~~~~~ Patern ~~~~~~~~~~~~~~~~~ ";PX
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for Intr =1 to 75
scan
print " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ";Intr
AccuIntr=AccuIntr+Intr:ICnt=ICnt+1
gosub [Dsp1]
X2$=""
'
for AodWt=1 to NhWt
bias=val(word$(Hdnbis$,AodWt))
if AodWt=2 then WH$=WH2$
Fedset=0':FSum=0
[Feed]
Fedset=Fedset+1
''print word$(X1$,Fedset);" ";word$(WH$,Fedset)
x=val(word$(X1$,Fedset)):w=val(word$(WH$,Fedset))
FSum=FSum+(x*w)
if Fedset<Lng(X1$) then [Feed]
BisSum$=str$(FSum+bias)
Call Sigmoid$ Sigmoid$,BisSum$
Op1$=Sigmoid$
X2$=X2$;Op1$;" "
'print " Op1$ ";Op1$
Op$=Op1$:CarryOp$=Op$
next AodWt
'
'print " X2$ ";X2$
WH$=OWt$:wSum=0
bias=val(word$(Obais$,1))
for x2=1 to Lng(X2$)
x=val(word$(X2$,x2)):w=val(word$(WH$,x2))
wSum=wSum+(x*w)
next x2
BisSum$=str$(wSum+bias)
Call Sigmoid$ Sigmoid$,BisSum$
'print "~~~~~~~~~~~~ Op1$ ";Op1$
Op1$=Sigmoid$
Op$=Op1$':OpExspect$=str$(1)
print tab(16);Op$;" ";X1$
gosub [CallError]
if val(Error$)<1e-15 then gosub [Correct.Logic$]
'
gosub [CallOpt.Optbias]
OldOpt$=Optbias$
CapOperr$=Optbias$;" "
for bc=1 to Lng(X2$)
GvnOpt$=word$(X2$,bc):GvnWt$=word$(OWt$,bc)
gosub [CallHdnOptbias$]
CapOperr$=CapOperr$;Hdn.Optbias$;" "
next bc
'print CapOperr$
gosub [WtAdjust]
OptErrbias$=word$(CapErrOp$,1):OldOpt$=word$(ExOldOp$,1)
gosub [CallWtDff]
aOtOldWt$=word$(ExOldOp$,1)
gosub [CallWtNew]
CapW$=NewWt$;" "
Obais$=NewWt$
Hdnbis$=""
for Bud=1 to Lng(X2$)
OptErrbias$=word$(CapErrOp$,1+Bud):OldOpt$=word$(ExOldOp$,1+Bud)
gosub [CallWtDff]
aOtOldWt$=word$(ExOldOp$,1+Bud)
gosub [CallWtNew]
CapW$=CapW$;NewWt$;" "
Hdnbis$=Hdnbis$;NewWt$
next Bud
'print " CapW$ ";CapW$
'print " Obais$ ";Obais$
'print " Hdnbis$ ";Hdnbis$
' WH$=""
' for xj=1 to 2
' if xj>1 then WH2$=""
' for xq=1 to Lng(X1$)
' xc=xc+1
' if xj=1 then WH$=WH$;word$(CapWt$,xc);" "
' if xj>1 then WH2$=WH2$;word$(CapWt$,xc);" "
' next xq
' next xj
' print " WH$ ";WH$
' print " WH2$ ";WH2$
next Intr
[PttrnExit]
if PX=Pxlmt then [SysExit]
if PX<Pxlmt then [Ptrn]
[SysExit]
print WH$
print WH2$
print " Capcorrect$ ";Capcorrect$
print "Fit is ";((ICnt/AccuIntr)/0.83333333)
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[quit]
end
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[WtAdjust]
CapErrOp$="0.1311 -0.0087 -0.0065"
'print " X2$ ";X2$
Prv$="";Prv2$=""
'XXX???
'XXX???
for Oeo=1 to Lng(X1$)
for Geo=1 to Lng(X2$)
xj=xj+1
Optbias$=word$(CapOperr$,Geo)
HdnOp$=word$(X1$,Oeo)
'print " CapErrOp$ ";CapErrOp$
if Geo=1 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH$,Oeo)':print tab(14);" OldErrOpt$ ";OldErrOpt$
if Geo=2 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH2$,Oeo)':print tab(18);" OldErrOpt$ Gvn ";OldErrOpt$
'print " Optbias$ ";Optbias$
'print xj,Wtbias$,OldErrOpt$,HdnOp$
'
OptErrbias$=OldErrOpt$:OldOpt$=HdnOp$
'print "~~~~~~~~~~ OldErrOpt$ ";OldErrOpt$;" OldOpt$ ";OldOpt$
'OptErrbias$=OldErrOpt$
gosub [CallWtDff]
'
aOtOldWt$=Wtbias$ ' DffWt$
gosub [CallWtNew]
CapWt$=CapWt$;NewWt$;" "
next Geo
'
next Oeo
' CapWt$=CapWt$;"__"
'print " CapWt$ ";CapWt$
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Correct.Logic$]
if Error$<=str$(1e-15) then 'str$(0.2261111)
' if val(Op$)<>1 then
' Capcorrect$=Capcorrect$;Op$;" "
' print tab(36);" Activated ";" Op$ ";CarryOp$
if (0+instr(rdCorrect$,Op$))=0 then
gosub [PerGs]
print tab(50);" FIRE "
end if
' end if
' if val(CarryOp$)>0.98984 then
' Target$=str$((val(OpExspect$)*val(CarryOp$)))
'print tab(36);Target$
'if val(Target$)>0.922 then
gosub [SecDsply]
goto [PttrnExit]
' end if
' end if
end if
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'
Function Lng(byref Stream$)
[loop]
q=q+1
Ck$=word$(Stream$,q)
if Ck$<>"" then [loop]
Lng=q-1
end function
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'Call Sigmoid$ Sigmoid$,Sum$
Sub Sigmoid$ byref Unk1$,byref Unk2$
Unk1$=str$(1/(1+exp(val(Unk2$)*-1)))
end sub
[Sig]
Call Sigmoid$ Sigmoid$,Sum$
return
'
Sub Error$ byref Unk3$,byref Unk1$,byref Unk2$
Unk3$=str$(val(Unk2$)-val(Unk1$))
end sub
[CallError]
Call Error$ Error$,Op$,OpExspect$
'print tab(36);" Error$ ";Error$
return
'
Sub Optbias$ byref Unk3$,byref Unk1$,byref Unk2$
''print " ";Unk1$,Unk2$
Unk3$=str$(val(Unk1$)*(1-val(Unk1$))*(val(Unk2$)-val(Unk1$)))
end sub
[CallOpt.Optbias]
Call Optbias$ Optbias$,Op$,OpExspect$
'print " Opt.Optbias$ ";Optbias$
return
'
Sub Hdn.Optbias$ byref Unk5$,byref Unk1$,byref Unk2$,byref Unk3$,byref Unk4$
Unk5$=str$(val(Unk1$)*(1-val(Unk1$))*(val(Unk2$))*val(Unk3$))
end sub
[CallHdnOptbias$]
'print GvnOpt$,GvnWt$,OldOpt$
Call Hdn.Optbias$ Hdn.Optbias$,GvnOpt$,GvnWt$,OldOpt$,Optbias$
'print " Hdn.Optbias$ ";Hdn.Optbias$
return
'
Sub DffWt$ byref Unk4$,byref Unk1$,byref Unk2$,byref Unk3$
Unk4$=str$(val(Unk1$)*(val(Unk2$)*val(Unk3$)))'*(1/(val(Error$)^2)))
end sub
[CallWtDff]
'print OptErrbias$,OldOpt$
call DffWt$ DffWt$,Lr$,OptErrbias$,OldOpt$
'print " DffWt$ ";DffWt$
return
'
Sub NewWt$ byref Unk3$,byref Unk1$,byref Unk2$
Unk3$=str$(val(Unk1$)+val(Unk2$))
end sub
'
[CallWtNew]
call NewWt$ NewWt$,DffWt$,aOtOldWt$
'print " NewWt$ ";NewWt$
return
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[Input11]
'X1$ WH1$ WH2$ OWt$ OBias$ Hdnbias$
'Data "1 0 1","0.2 0.4 -0.5","-0.3 0.1 0.2","-0.3 -0.2","0.1","-0.4 0.2"
Data "0.3845e-3 0.475e-2 0.8424 0.58342e-2 0.4725 0.93264e-1","0.2e-3 0.4e-5 -0.5 -0.2 0.3e-7 -0.1","-0.3 0.1e-4 0.2 0.2e-7 -0.4e-5 -0.2","-0.3 -0.2","0.1","-0.4 0.2"
[Patterns]
Data "1 0 1 1 1 0","0 1 1 0 1 0","1 1 0 1 1 0","1 0 0 1 1 0"
'
[TstPatterns]
' 1XX 2XX 3* 4XX 5* 6XX 7* 8XX 9*
Data "1 1 1 1 1 0","1 0 1 0 0 1","1 0 1 1 1 0","1 0 0 1 0 0","0 1 1 0 1 0","1 1 1 0 1 0","1 1 0 1 1 0","1 1 0 1 1 1","1 0 0 1 1 0"
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[GetDTAS]
'read X1$
' read WH$
' read WH2$
' WH$="-3.94380628 3.41242576 5.86352165 -2.84657561 1.9467552 -1.45021985"
' WH2$="-1.10650034 1.89783797 3.69891394 2.07168245 0.65237251 5.44987989"
read OWt$
read Obais$
read Hdnbis$
BWH$=WH$
BWH2$=WH2$
ExOldOp$="209 1.994 -0.416"
NhWt=2:OpExspect$=word$(rdCorrect$,pttrn):Lr$=str$(0.9)
return
[Dsp1]
WH$="":WH2$=""
'print X1$
' 'print WH$
' 'print WH2$
for wq=1 to 2
for wj=1 to Lng(X1$)
if wq=1 then WH$=WH$;str$((rnd(0.5)+1e-22)*1e1-4);" "
if wq>1 then WH2$=WH2$;str$((rnd(0.5)+1e-22)*1e1-3);" "
next wj
next wq
WH$="5.48135759 1.44427372 5.82318889 5.1547191 6.26680216 -2.68556499"
WH2$="1.04304859 2.75476629 -0.10393762 0.56375753 -2.93664628 2.96154259"
' 1 2 3 4 5 6 7 8 9
' rdCorrect$="0.50123786 0.50128872 0.50133277 0.50046735 0.50124773 0.50131421 0.50124041 0.50017406 0.5013336"
rdCorrect$="0.50133362 0.50133362 0.50133362 0.5013336"
' 5---4
' 5---4
print WH$
print WH2$
'print OWt$
'print Obais$
'print Hdnbis$
return
[SecDsply]
'print X1$
'print "###### ";WH$
'print "###### ";WH2$
'print OWt$
'print Obais$
'print Hdnbis$
return
[PerGs]
CapErrOp$="0.1311 -0.0087 -0.0065"
'print " X2$ ";X2$
Prv$="";Prv2$=""
'XXX???
'XXX???
for Oeo=1 to Lng(X1$)
for Geo=1 to Lng(X2$)
xj=xj+1
Optbias$=word$(CapOperr$,Geo)
HdnOp$=word$(X1$,Oeo)
'print " CapErrOp$ ";CapErrOp$
if Geo=1 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH$,Oeo)':print tab(14);" OldErrOpt$ ";OldErrOpt$
if Geo=2 then OldErrOpt$=word$(CapErrOp$,1+Geo):Wtbias$=word$(BWH2$,Oeo)':print tab(18);" OldErrOpt$ Gvn ";OldErrOpt$
'print " Optbias$ ";Optbias$
'print xj,Wtbias$,OldErrOpt$,HdnOp$
'
OptErrbias$=OldErrOpt$:OldOpt$=HdnOp$
'print "~~~~~~~~~~ OldErrOpt$ ";OldErrOpt$;" OldOpt$ ";OldOpt$
'OptErrbias$=OldErrOpt$
gosub [CallWtDff]
'
aOtOldWt$=Wtbias$ ' DffWt$
gosub [CallWtNew]
CapWt$=CapWt$;NewWt$;" "
next Geo
'
next Oeo
' CapWt$=CapWt$;"__"
'print " CapWt$ ";CapWt$
return