Пример #1
0
        public override WeightsMatrix WeightsUpdate(WeightsMatrix gradient)
        {
            WeightsMatrix result = gradient.Copy();

            result.Scale(-_stepSize / _batchSize);
            return(result);
        }
Пример #2
0
        public WeightedCombiner(WeightsMatrix weights, NetworkVector biases)
            : base(weights.NumberOfOutputs, weights.NumberOfInputs)
        {
            if (weights == null)
            {
                throw new ArgumentException("Attempt to make a WeightedCombineer with weights == null.");
            }

            if (biases == null)
            {
                throw new ArgumentException("Attempt to make a WeightedCombineer with biases == null.");
            }

            if (biases.Dimension != weights.NumberOfOutputs)
            {
                throw new ArgumentException("Dimension of biases must the the same of the outputs.");
            }

            Weights     = weights.Copy();
            Biases      = biases.Copy();
            VectorInput = new NetworkVector(weights.NumberOfInputs);
            //Output = new NetworkVector(weights.NumberOfOutputs);
        }