Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public static void BackgroundLearn(NetworkMatrix net)
 {
     while (true)
     {
         net.Learn();
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 public LayerState(NetworkMatrix weights, NetworkVector biases)
 {
     Biases  = biases.ToArray();
     Weights = weights.ToArray();
 }
Exemplo n.º 5
0
 public WeightedCombiner(NetworkMatrix weights)
     : this(weights, new NetworkVector(weights.NumberOfOutputs))
 {
 }
Exemplo n.º 6
0
 public WeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : this(weights, biases, TrainingMode.ONLINE)
 {
 }
Exemplo n.º 7
0
 public BatchWeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : base(weights, biases)
 {
     _biasesDelta  = new NetworkVector(NumberOfOutputs);
     _weightsDelta = new NetworkMatrix(NumberOfOutputs, NumberOfInputs);
 }
Exemplo n.º 8
0
 public OnlineWeightedCombiner(NetworkMatrix weights, NetworkVector biases)
     : base(weights, biases)
 {
 }