3 ms·
Some of you may like seeing the two level neural network code translated to kona (or k3)! nonlin:{:[y;x*1-x;1%1+_exp -x]} x:(0 0 1;0 1 1;1 0 1;1 1 1)
by bakul 11y ago
Some of you may like seeing the two level neural network code translated to kona (or k3)!
nonlin:{:[y;x*1-x;1%1+_exp -x]}
x:(0 0 1;0 1 1;1 0 1;1 1 1)
y:+,0 0 1 1
syn0:-0.5+3 1 _draw 0
step:{L1:nonlin[x _mul syn0;0]
L1err:y-L1
L1delta:L1err*nonlin[L1;1]
syn0+:(+x)_mul L1delta;L1}
do[10000;L1:step[x;y]]
L1
(,0.009668795
,0.007862982
,0.9935916
,0.9921171)
k3 does this in 140ms, Kona in 2030ms on the same machine.