Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input[1] = collision_ray(1,-40);
- input[2] = collision_ray(2,-20);
- input[3] = collision_ray(3,0);
- input[4] = collision_ray(4,20);
- input[5] = collision_ray(5,40);
- //Hidden Layer logic
- var n1;//Node 1
- n1 = (input[1] * input1weight[1]) +
- (input[2] * input2weight[1]) +
- (input[3] * input3weight[1]) +
- (input[4] * input4weight[1]) +
- (input[5] * input5weight[1]) ;
- node[1] = dsin(n1);
- var n2;//Node 2
- n2 = (input[1] * input1weight[2]) +
- (input[2] * input2weight[2]) +
- (input[3] * input3weight[2]) +
- (input[4] * input4weight[2]) +
- (input[5] * input5weight[2]) ;
- node[2] = dsin(n2);
- var n3;//Node 3
- n3 = (input[1] * input1weight[3]) +
- (input[2] * input2weight[3]) +
- (input[3] * input3weight[3]) +
- (input[4] * input4weight[3]) +
- (input[5] * input5weight[3]) ;
- node[3] = dsin(n3);
- var n4;//Node 4
- n4 = (input[1] * input1weight[4]) +
- (input[2] * input2weight[4]) +
- (input[3] * input3weight[4]) +
- (input[4] * input4weight[4]) +
- (input[5] * input5weight[4]) ;
- node[4] = dsin(n4);
- var n5;//Node 5
- n5 = (input[1] * input1weight[5]) +
- (input[2] * input2weight[5]) +
- (input[3] * input3weight[5]) +
- (input[4] * input4weight[5]) +
- (input[5] * input5weight[5]) ;
- node[5] = dsin(n5);
- //Network output
- var out1, out2, out3;
- out1 = (node[1] * node1weight[1]) + (node[2] * node2weight[1]) + (node[3] * node3weight[1]) + (node[4] * node4weight[1]) + (node[5] * node5weight[1]);
- out2 = (node[1] * node1weight[2]) + (node[2] * node2weight[2]) + (node[3] * node3weight[2]) + (node[4] * node4weight[2]) + (node[5] * node5weight[2]);
- out3 = (node[1] * node1weight[3]) + (node[2] * node2weight[3]) + (node[3] * node3weight[3]) + (node[4] * node4weight[3]) + (node[5] * node5weight[3]);
- output[1] = out1;
- output[2] = out2;
- output[3] = out3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement