aeTIos and 1 Guest are viewing this topic.

Ans->|LARGS0.1->CIf 1=|LARGS(1seq(2rand-1,I,1,|LARGS(2->|LWTSIf 2=|LARGS(1Then DelVar S For(I,3,dim(|LARGS)-1 S+|LARGS(I)*|LWTS(I-2->S End 1-2(S<0->thetaEndIf 3=|LARGS(1Then |LARGS(2->D dim(|LARGS)-2->dim(|LA DelVar S ~1+2(5>2sum(seq(|LARGS(I)*|LWTS(I-2),I,3,dim(|LARGS)-1->S D-Ans->E For(I,1,dim(|LWTS C*E*|LARGS(I+2->|LB(I |LWTS(I)+C*E*|LARGS(I+2->|LWTS(I End {E,S,|LB(1),|LB(2End

Menu("RESUME TRAINING?","YES",02,"NO",03Lbl 033->dim(|LZYZYZFill(0,|LZYZYZ1->|LZYZYZ(1ClrDraw{1,2:prgmPERCEPTLbl 02Input "NUMBER OF TRIALS: ",A|LZYZYZ(2->I%A->|NRepeat not(|N |N-1->|N Text(0,1,|LZYZYZ(1 Text(12,1,|LZYZYZ(2 Text(24,1,|LZYZYZ(1)-|LZYZYZ(2 randInt(~100,100,2->L1 1-2(L1(1)>L1(2 augment({3,Ans},L1->|LZ prgmPERCEPT Ans->L1 If Ans(1 Pt-On(|LZ(3),|LZ(4),Black,3 |LZYZYZ(2)+not(Ans(1->|LZYZYZ(2 Pt-On(|LZ(3),|LZ(4),Black+L1(2),1 1+|LZYZYZ(1->|LZYZYZ(1End

Drag both onto CE/CSE (monochrome may work)Launch prgmTRAINDo not change the name of prgmPERCEPT.Bugs/Modifications are welcome.If there is any code that doesn’t run (I’m talking about stuff in prgmPERCEPT), it is there for later versions.Thanks!~iPhoenix

"Change to {0 (instead of {1}) if you do not want to see the nerd stuff :P{1->|LDEBUGrand(6->|LN1rand(3->|LN2DelVar theta{0,1,0,1->|LIN1{0,0,1,1->|LIN2{0,1,1,0->|LIN3Repeat 0 theta+1->theta Disp "---","Trial Num: "+toString(theta 1+remainder(theta-1,4->I |LIN1(I->|LINPUT(1 |LIN2(I->|LINPUT(2 |LIN3(I->Z Disp "Expected Output: "+toString(Z For(A,1,2 Disp "Input "+toString(A)+": "+toString(|LINPUT(A End Disp "---","" DelVar P For(A,1,3 DelVar S For(I,0,3,3 S+|LINPUT(I/3+1)*|LN1(A+I->S End S->L2(A 1/(1+e^(~S->|LRES(A End |LRES*|LN2->|LRES sum(|LRES->A 1/(1+e^(~A))->A For(N,1,3 If sum(|LDEBUG:Then Disp "Synapse "+toString(N Disp "Expected: "+toString(Z),"Result: "+toString(A),"Error: "+toString(Z-A End Z-A->E nDeriv(1/(1+e^(~B)),B,A)*E->C If sum(|LDEBUG Disp "Change: "+toString(C |LN2(N->L3(N C+|LN2(N->|LN2(N If sum(|LDEBUG:Then Disp "old:"+toString(L3(N Disp "new:"+toString(|LN2(N Disp "" End End If sum(|LDEBUG Disp "","Input-Hidden:" For(A,1,3 L2(A->O C*L3(A)*nDeriv(1/(1+e^(~X)),X,O)->L4(A If sum(|LDEBUG Disp "Change "+toString(A)+": "+toString(Ans End For(A,1,3 |LINPUT(1->L5(A |LINPUT(2->L5(A+3 End 3->dim(L4 augment(L4,L4->L4 L4*L5->L5 |LN1+L5->|LN1 If sum(|LDEBUG:Then For(A,1,12 If A<6 Disp "old: "+toString(|LN1(A)-L5(A If A=6 Disp "" If A>6 Disp "new: "+toString(|LN1(A-6 End End Disp "",""EndEnd

Disp

Great job.

FacebookandTwitterFollow @Codewalr_us