Exemple #1
0
        public static WeightedValue CreateWeightedValue(IList <IValue> values)
        {
            double[] weights = new double[values.Count];

            for (int k = 0; k < weights.Length; k++)
            {
                weights[k] = (random.NextDouble() * 2) - 1;
            }

            WeightedValue value = new WeightedValue(values, weights);

            return(value);
        }
        public NeuronLayeredNetwork(IList <int> arities)
        {
            this.layers = new IList <IValue> [arities.Count];

            this.layers[0] = new List <IValue>();

            for (int k = 0; k < arities[0]; k++)
            {
                this.layers[0].Add(new RealValue());
            }

            for (int k = 1; k < arities.Count; k++)
            {
                this.layers[k] = new List <IValue>();

                for (int j = 0; j < arities[k]; j++)
                {
                    this.layers[k].Add(new Neuron(WeightedValue.CreateWeightedValue(this.layers[k - 1])));
                }
            }
        }
Exemple #3
0
        public WeightedValue CreateWeightedValue()
        {
            IList <IValue> values = new List <IValue>(this.neurons);

            return(WeightedValue.CreateWeightedValue(values));
        }