Hello, I am trying to create the most simplest NN from following this video:
The trouble I am having is I am not getting the same output, I blieve I have copied all of the weights correctly blue lines = -1 red = 1 I am a step function.
Code:
local f = function(x)
if x < 0 then
return 0
else
return 1
end
end
local Weights = {
-1,
1,
-1,
1,
-1,
1,
-1,
1,
1,
1,
1,
1,
1,
1,
}
local b1 = 1
local Undefined = function(x1, x2, x3, x4)
local hln1 = f(x1 * Weights[1] + x2 * Weights[2] + b1)
local hln2 = f(x1 * Weights[3] + x2 * Weights[4] + b1)
local hln3 = f(x3 * Weights[5] + x4 * Weights[6] + b1)
local hln4 = f(x3 * Weights[7] + x4 * Weights[8] + b1)
local hl2n1 = f(hln1 * Weights[9] + hln2 * Weights[10] + b1)
local hl2n2 = f(hln3 * Weights[11] + hln4 * Weights[12] + b1)
local Output = f(hl2n1 * hl2n2)
return Output
end
x1 are the tiles on the board so -1 == a white tile and 1 is equal to a black tile so
x1 = White
x2 = Black
x3 = Black
x4 = Black
I think I am doing right hl = hiddenlayer n = neuron. But i have a feeling I am doing something wrong with the weights.
If anyone has any expirnce in the neural netwrok see please help me, also if you could any links to combining GA with NN’s would also be very helpful thanks.