Exemple #1
0
        public WeightedCombiner(NetworkMatrix weights, NetworkVector biases, TrainingMode mode)
            : base(mode)
        {
            if (weights == null)
            {
                throw new ArgumentException("Attempt to create a WeightedCombiner with null weights.");
            }

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

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

            _weights = weights.Copy();
            _biases  = biases.Copy();

            _inputs        = new NetworkVector(NumberOfInputs);
            _outputs       = new NetworkVector(NumberOfOutputs);
            _inputGradient = new NetworkVector(NumberOfInputs);
        }
 public static void BackgroundLearn(NetworkMatrix net)
 {
     while (true)
     {
         net.Learn();
     }
 }
Exemple #3
0
        public WeightedCombiner(WeightedCombiner combiner)
        {
            if (combiner == null)
            {
                throw new ArgumentException("Attempt to make a WeightedCombiner from null");
            }

            this._biases  = combiner._biases.Copy();
            this._weights = combiner._weights.Copy();
            this.Mode     = combiner.Mode;
        }
Exemple #4
0
 public LayerState(NetworkMatrix weights, NetworkVector biases)
 {
     Biases  = biases.ToArray();
     Weights = weights.ToArray();
 }
Exemple #5
0
 public WeightedCombiner(NetworkMatrix weights)
     : this(weights, new NetworkVector(weights.NumberOfOutputs))
 {
 }
Exemple #6
0
 public WeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : this(weights, biases, TrainingMode.ONLINE)
 {
 }
Exemple #7
0
 public BatchWeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : base(weights, biases)
 {
     _biasesDelta  = new NetworkVector(NumberOfOutputs);
     _weightsDelta = new NetworkMatrix(NumberOfOutputs, NumberOfInputs);
 }
Exemple #8
0
 public OnlineWeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : base(weights, biases)
 {
 }