public virtual Neuron Clone(InnovationNumber otherInnov) { var clone = Clone(); clone.InnovationNb = otherInnov; return(clone); }
public override Neuron Clone(InnovationNumber otherInnov) { var clone = this.Clone(); clone.InnovationNb = otherInnov; return(clone); }
public MemoryNeuron( InnovationNumber innovationNumber, InnovationNumber targetNeuron ) : base(innovationNumber, null) { this.TargetNeuron = targetNeuron; }
/// <summary> /// Check equality between two <see cref="NodeGene"/>s /// </summary> /// <param name="obj">Another <see cref="NodeGene"/></param> /// <returns>a boolean that confirm or not the equality</returns> public override bool Equals(object obj) { if (obj is NodeGene n) { return(InnovationNumber.Equals(n.InnovationNumber)); } return(false); }
/// <summary> /// Gets the hash code. /// </summary> /// <returns>Returns the hash code.</returns> public override int GetHashCode() { int hashCode = 1721005899; hashCode = hashCode * -1521134295 + InId.GetHashCode(); hashCode = hashCode * -1521134295 + OutId.GetHashCode(); hashCode = hashCode * -1521134295 + InnovationNumber.GetHashCode(); hashCode = hashCode * -1521134295 + Weight.GetHashCode(); hashCode = hashCode * -1521134295 + Enabled.GetHashCode(); return(hashCode); }
public Synapse AddConnection( InnovationNumber startNeuron, InnovationNumber endNeuron, WeightInitializer weightInitializer = null) { if (!Neurons.ContainsKey(startNeuron) || !Neurons.ContainsKey(endNeuron)) { throw new Exception("The given neurons are not yer registered."); } var innov = synapseInnovNbTracker.GetHystoricalMark(startNeuron, endNeuron); var result = new Synapse(innov, 0, startNeuron, endNeuron) { weightConstraints = this.WeightConstraints }; if (weightInitializer == null) { weightInitializer = defaultWeightInitializer; } Synapses.Add(result, weightInitializer); return(result); }
public IEnumerable <NeuralGene> GetGenesOutOfNeuron(InnovationNumber target) { return(NeuralGenes.Where(x => x.Synapse.incoming == target)); }
public IEnumerable <NeuralGene> GetGenesToNeuron(InnovationNumber target) { return(NeuralGenes.Where(x => x.Synapse.outgoing == target)); }