ASK java levenberg-marquardt algorithm -
i try implement levenberg algorithm in java code, met difficulties, dont know whats problems, number of mse doesnt going down. made network 1 hidden layer, 18 input's neurons, 7 hidden's neurons, , 3 output's neuron. these formula use calculate jacobian matrix:
- b2=f'(yin)
- wjk=b2*zj
- din=sum(b2*wjk)
- b1=din*f'(zin)
- vij=b1*xi
all of it, save in jacobian matriks
j[iteration][]={vij,b1,wjk,b2} to network error, multiply jacobian transpose find it's gradient used code:
public double err(int[]t,double[]y){ double err=0; for(int z=0;z<out;z++){ err+=t[z]-y[z]; }return err; } and calculate mse of network used code:
public double mse(int[]t,double[]y){ double mse=0; for(int z=0;z<out;z++){ mse+=math.pow(t[z]-y[z],2); }return mse; } both error , mse function called when iterate data input, , sum of mse divide sum of data input.
Comments
Post a Comment