synapse0=RandomVariate[NormalDistribution[0,1],3]
sigmoid[x_]=1.0/(1+Exp[-x]); sigmoidderivation[x_]=x*(1.0-x);
sigmoid/@X==sigmoid[X]
Do[{layer0=X;layer1=sigmoid[Dot[layer0,synapse0]];
layer1error=layer1-Y;
layer1delta=layer1error*sigmoidderivation[layer1];
synapse0derivative=Dot[Transpose[layer0],layer1delta];
synapse0=synapse0-synapse0derivative},{i,100}]
TableForm[{X,layer1,Y}]
No comments:
Post a Comment