You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no idea what bias is in the genetic.js. Is it a keyword?
crossOver : function(parentA, parentB) {
var cutPoint = this.random(0, parentA.neurons.length-1);
for (var i = cutPoint; i < parentA.neurons.length; i++){
//what is the bias part. what does it mean
var biasFromParentA = parentA.neurons[i]['bias'];
parentA.neurons[i]['bias'] = parentB.neurons[i]['bias'];
parentB.neurons[i]['bias'] = biasFromParentA;
}
return this.random(0, 1) == 1 ? parentA : parentB;
},
Similarly, is connections a keyword? What is this achieveing?
mutation : function (offspring){
for (var i = 0; i < offspring.neurons.length; i++){
offspring.neurons[i]['bias'] = this.mutate(offspring.neurons[i]['bias']);
}
//is connections a keyword?
for (var i = 0; i < offspring.connections.length; i++){
offspring.connections[i]['weight'] = this.mutate(offspring.connections[i]['weight']);
}
return offspring;
},
Also, the function 'activate' is not referenced anywhere. I am not sure if that is a keyword because intellisense didn't pick it up. Could somebody tell me how the activate function working?
activateBrain: function(bird, target){
var horizontalDistance = this.normalize(target.x,700) *this.SCALE_FACTOR;
var verticalDistance = this.normalize(bird.y - target.y,800) * this.SCALE_FACTOR;
var inputs = [horizontalDistance,verticalDistance];
//not sure what activate is
var outputs = this.Population[bird.index].activate(inputs);
if(outputs[0] > 0.5) bird.flap();
},
Would appreciate if somebody could help me understand these 3 things. Thank you so much.
The text was updated successfully, but these errors were encountered:
I have no idea what bias is in the genetic.js. Is it a keyword?
Similarly, is connections a keyword? What is this achieveing?
Also, the function 'activate' is not referenced anywhere. I am not sure if that is a keyword because intellisense didn't pick it up. Could somebody tell me how the activate function working?
Would appreciate if somebody could help me understand these 3 things. Thank you so much.
The text was updated successfully, but these errors were encountered: