Why this one input, one output and binary perceptron doesnt work?

I have this code:

peso=true
activar=(input)=>{
	if(peso==false){
		return !input
	}
	if(peso==true){
		return input
	}
}
aleatorizar=()=>{
	peso=Math.random()*2<1?false:true
}
entrenar=(input,output,charge)=>{
	for(i=0;i<charge;i++){
		if(activar(input)!==output){
			aleatorizar()
		}
	}
}
while(true){
	entrenar(false,true,10)
	entrenar(true,true,10)
	console.log(
		"false => "+activar(false)+
		" true => "+activar(true)
	)
}

The solution: A working binary perceptron than can activate and deactivate NOT gate via ‘peso’ variable (neural weight) Its possible? Thanks anyway.

ow, my head.

What’s it supposed to do, exactly? The logic of this thing defies…well, logic.

Acting a binary perceptron.

right but saying the words doesnt make it a thing.

a perceptron is a simple neural network.

your code makes charge attempts to turn peso into input by flipping a coin.

I dont… see how this is in any way related.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.