コード例 #1
0
        /// <summary>
        /// Initalizes an ANeuron.
        /// Notes:
        ///     -Initalizes Threshold to a Random Float.
        /// </summary>
        /// <param name="passedNumberOfWeights">The Number of Weights for the Neuron.</param>
        /// <param name="passedActivationFunction">The Activation Function for the Neuron</param>
        public ANeuron(uint passedNumberOfWeights, IActivationFunction passedActivationFunction)
        {
            this._Weights            = GenerateWeights(passedNumberOfWeights);
            this._ActivationFunction = passedActivationFunction;

            InitalizeWeights();

            this._Threshold = new NeuronThreshold(Config.RANDOM.NextFloat());
        }
コード例 #2
0
        /// Initalizes an ANeuron.
        /// </summary>
        /// <param name="passedNumberOfWeights">The Number of Weights for the Neuron.</param>
        /// <param name="passedThreshold">The Threshold for the Neuron.</param>
        /// <param name="passedActivationFunction">The Activation Function for the Neuron</param>
        public ANeuron(uint passedNumberOfWeights, float passedThreshold, IActivationFunction passedActivationFunction)
        {
            this._Weights            = GenerateWeights(passedNumberOfWeights);
            this._ActivationFunction = passedActivationFunction;

            InitalizeWeights();

            this._Threshold = passedThreshold;
        }
コード例 #3
0
        public void SetNeuronLayerWeights(INeuronLayerNeuronWeights passedNeuronWeights)
        {
            IEnumerator <INeuronWeights> neuronWeightsEnumerator = passedNeuronWeights.Values;
            uint neuronIndex = 0;

            while (neuronWeightsEnumerator.MoveNext())
            {
                INeuronWeights current = neuronWeightsEnumerator.Current;
                INeuron        neuron  = this._Neurons[(int)neuronIndex++];
                neuron.Weights = current;
            }
        }
コード例 #4
0
 public Neuron(INeuronWeights passedNeuronWeights, INeuronThreshold passedThreshold, INeuronActivationFunction passedActivationFunction) : base(passedNeuronWeights, passedThreshold, passedActivationFunction)
 {
 }
コード例 #5
0
 public ANeuron(INeuronWeights passedNeuronWeights, INeuronThreshold passedThreshold, INeuronActivationFunction passedActivationFunction)
 {
     this.Weights             = passedNeuronWeights;
     this._ActivationFunction = passedActivationFunction;
     this.Threshold           = passedThreshold;
 }
コード例 #6
0
 public ANeuron(INeuronWeights passedNeuronWeights, INeuronActivationFunction passedActivationFunction)
 {
     this.Weights             = passedNeuronWeights;
     this._ActivationFunction = passedActivationFunction;
     this.Threshold           = new NeuronThreshold(Config.RANDOM.NextFloat());
 }
コード例 #7
0
 public ANeuron(uint passedNumberOfWeights, INeuronThreshold passedThreshold, INeuronActivationFunction passedActivationFunction)
 {
     this._Weights            = GenerateWeights(passedNumberOfWeights);
     this._ActivationFunction = passedActivationFunction;
     this._Threshold          = passedThreshold;
 }