hello, I'm making a program that is supposed to imitate a simple neurone. The idea is that after it has calculated the net input, it decides if the neurone will be activated or not, if the activation level is greater than 0 then it will, otherwise it will not be activated. I think it might be working OK, but it gives me the wrong type of answer, it's giving a number like _G440 instead. Here it is:
neuron([],[],Bias,Bias).
neuron([Input|InputTail],[Weight|WeightTail],Bias,Result):-
neuron(InputTail,WeightTail,Bias,Temp);
Temp2 is Temp + Input*Weight,
Temp2 > 0 -> Result = 1; Temp2 =< 0 -> Result = 0.
Where have I gone wrong? I'm new to this, so please forgive me if I've done something really dumb. Thanks for your time.
neuron([],[],Bias,Bias).
neuron([Input|InputTail],[Weight|WeightTail],Bias,Result):-
neuron(InputTail,WeightTail,Bias,Temp);
Temp2 is Temp + Input*Weight,
Temp2 > 0 -> Result = 1; Temp2 =< 0 -> Result = 0.
Where have I gone wrong? I'm new to this, so please forgive me if I've done something really dumb. Thanks for your time.