У меня не работает код нейросети на pixilang
Выводит это
ERROR (line 253)
in C:/Users/Artemy/Desctop/pixilang/pixilang3/examples/neural.pixi
syntax error
код
N0=new(10,2,FLOAT)
N0[9,0]=1
N1=new(5,2,FLOAT)
N1[4,0]=1
N2=new(4,2,FLOAT)
N2[3,0]=1
N3=new(2,2,FLOAT)
IDL=new(2,1,FLOAT)
W01=new(10,4,FLOAT)
W12=new(5,3,FLOAT)
W23=new(4,2,FLOAT)
fn getError(){
ret N0[0,1]+N0[1,1]+N0[2,1]+N0[3,1]+N0[4,1]+N0[5,1]+N0[6,1]+N0[7,1]+N0[8,1]+N0[9,1]+N1[0,1]+N1[1,1]+N1[2,1]+N1[3,1]+N1[4,1]+N2[0,1]+N2[1,1]+N2[2,1]+N3[0,1]+N3[1,1]
}
fn setinput($in){
N0[0,0]=$in[0,0]
N0[1,0]=$in[1,0]
N0[2,0]=$in[2,0]
N0[3,0]=$in[0,1]
N0[4,0]=$in[1,1]
N0[5,0]=$in[2,1]
N0[6,0]=$in[0,2]
N0[7,0]=$in[1,2]
N0[8,0]=$in[2,2]
}
fn getTask($i){
$return=new(3,3,FLOAT)
if $i % 16 ==0 {
IDL[0,0]=1
IDL[1,0]=0
$return[0,0]=1
$return[1,0]=1
$return[2,0]=1
$return[0,1]=0
$return[1,1]=0
$return[2,1]=0
$return[0,2]=0
$return[1,2]=0
$return[2,2]=0
}
if $i%16==1{
IDL[0]=1
IDL[1]=0
$return[0,0]=0
$return[1,0]=0
$return[2,0]=0
$return[0,1]=1
$return[1,1]=1
$return[2,1]=1
$return[0,2]=0
$return[1,2]=0
$return[2,2]=0
}
if $i%16==2{
IDL[0]=1
IDL[1]=0
$return[0,0]=0
$return[1,0]=0
$return[2,0]=0
$return[0,1]=0
$return[1,1]=0
$return[2,1]=0
$return[0,2]=1
$return[1,2]=1
$return[2,2]=1
}
if $i%16==3{
IDL[0]=0
IDL[1]=1
$return[0,0]=1
$return[1,0]=0
$return[2,0]=0
$return[0,1]=1
$return[1,1]=0
$return[2,1]=0
$return[0,2]=1
$return[1,2]=0
$return[2,2]=0
}
if $i%16==4{
IDL[0]=0
IDL[1]=1
$return[0,0]=0
$return[1,0]=1
$return[2,0]=0
$return[0,1]=0
$return[1,1]=1
$return[2,1]=0
$return[0,2]=0
$return[1,2]=1
$return[2,2]=0
}
if $i%16==5{
IDL[0]=0
IDL[1]=1
$return[0,0]=0
$return[1,0]=0
$return[2,0]=1
$return[0,1]=0
$return[1,1]=0
$return[2,1]=1
$return[0,2]=0
$return[1,2]=0
$return[2,2]=1
}
if $i%16==6{
IDL[0]=1
IDL[1]=1
$return[0,0]=1
$return[1,0]=1
$return[2,0]=1
$return[0,1]=1
$return[1,1]=0
$return[2,1]=0
$return[0,2]=1
$return[1,2]=0
$return[2,2]=0
}
if $i%16==7{
IDL[0]=1
IDL[1]=1
$return[0,0]=1
$return[1,0]=1
$return[2,0]=1
$return[0,1]=0
$return[1,1]=1
$return[2,1]=0
$return[0,2]=0
$return[1,2]=1
$return[2,2]=0
}
if $i%16==8{
IDL[0]=1
IDL[1]=1
$return[0,0]=1
$return[1,0]=1
$return[2,0]=1
$return[0,1]=0
$return[1,1]=0
$return[2,1]=1
$return[0,2]=0
$return[1,2]=0
$return[2,2]=1
}
if $i%16==9{
IDL[0]=1
IDL[1]=1
$return[0,0]=1
$return[1,0]=0
$return[2,0]=0
$return[0,1]=1
$return[1,1]=1
$return[2,1]=1
$return[0,2]=1
$return[1,2]=0
$return[2,2]=0
}
if $i%16==10{
IDL[0]=1
IDL[1]=1
$return[0,0]=0
$return[1,0]=1
$return[2,0]=0
$return[0,1]=1
$return[1,1]=1
$return[2,1]=1
$return[0,2]=0
$return[1,2]=1
$return[2,2]=0
}
if $i%16==11{
IDL[0]=1
IDL[1]=1
$return[0,0]=0
$return[1,0]=0
$return[2,0]=1
$return[0,1]=1
$return[1,1]=1
$return[2,1]=1
$return[0,2]=0
$return[1,2]=0
$return[2,2]=1
}
if $i%16==12{
IDL[0]=1
IDL[1]=1
$return[0,0]=1
$return[1,0]=0
$return[2,0]=0
$return[0,1]=1
$return[1,1]=0
$return[2,1]=0
$return[0,2]=1
$return[1,2]=1
$return[2,2]=1
}
if $i%16==13{
IDL[0]=1
IDL[1]=1
$return[0,0]=0
$return[1,0]=1
$return[2,0]=0
$return[0,1]=0
$return[1,1]=1
$return[2,1]=0
$return[0,2]=1
$return[1,2]=1
$return[2,2]=1
}
if $i%16==14{
IDL[0]=1
IDL[1]=1
$return[0,0]=0
$return[1,0]=0
$return[2,0]=1
$return[0,1]=0
$return[1,1]=0
$return[2,1]=1
$return[0,2]=1
$return[1,2]=1
$return[2,2]=1
}
if $i%16==15{
IDL[0]=0
IDL[1]=0
$return[0,0]=0
$return[1,0]=0
$return[2,0]=0
$return[0,1]=0
$return[1,1]=0
$return[2,1]=0
$return[0,2]=0
$return[1,2]=0
$return[2,2]=0
}
ret $return
}
fn forWards($Li,$W,$Lo){
$wt=get_xsize($W)
$ht=get_ysize($W)
$y=0
while $y<$ht{
$Lo[$y,0]=0
$x=0
while $x<$wt{
$Lo[$y,0]=$Lo[$y,0]+Li[$x,0]*$W[$x,$y]
$x=x+1
}
$y=$y+1
}
}
fixOutError($IDL,$Lo){
$ws=get_xsize($Lo)
$x=0
while $x<$wh{
$Lo[$y,1]=0
$Lo[$x,1]=$IDL[$x,0]-Lo[$x,0]
$x=$x+1
}
}
fn findError($Li,$W,$Lo){
$wt=get_xsize($W)-1
$ht=get_ysize($W)
$x=0
while $x<$ht{
$Li[$x,1]=0
$y=0
while $y<$wt{
$Li[$x,1]=$Li[$x,1]+W[$x,$y]*$Lo[$y,1]
$y=y+1
}
$x=$x+1
}
}
fn backWard($Li,$W,$Lo,$k){
$wt=get_xsize($W)
$ht=get_ysize($W)
$y=0
while $y<$ht{
$x=0
while $x<$wt{
$W[$x,$y]=$W[$x,$y]+$k*$Lo[$y,1]*$Lo[$y,0]*(1-$Lo[$y,0])*$Li[$x,0]
$x=x+1
}
$y=$y+1
}
}
i=0
loop:
setinput(getTask(i))
forWards(N0,W01,N1)
forWards(N1,W12,N2)
forWards(N2,W23,N3)
fixOutError(IDL,N3)
findError(N2,W23,N3)
findError(N1,W12,N2)
backWards(N2,W23,N3,0.1)
backWards(N1,W12,N2,0.1)
backWards(N0,W01,N1,0.1)
print(getError())
goto loop