Moim zadaniem jest zaimplemenotwanie sieci neuronowej która realizuje bramke logiczna NAND:
Mój algorytm wyglada tak:
const arq = [1, 1, 1];
const weigths = [-0.5, -0.5, 0.6];
function neuron(arq, weigths) {
let sum = 0;
for(let i = 0; i < arq.length; i++){
let single = arq[i] * weigths[i]
sum += single
}
return decide(sum);
}
function decide(u){
if(u >= 0) return 1
else{
return 0
}
}
console.log(neuron(arq, weigths))
Zwraca 0
Jak na podstawie tego narysować wykres?