Beispiel #1
0
        public void AddInputPerceptron(string id, out Perceptron perceptron)
        {
            if (InputPerceptrons == null)
            {
                InputPerceptrons = new List <Perceptron>();
            }
            perceptron = InputPerceptrons.SingleOrDefault(p => p.Id == id);
            if (perceptron == null)
            {
                Perceptron inputPerceptron = perceptron = new Perceptron()
                {
                    Id = id
                };
                InputPerceptrons.Add(inputPerceptron);

                OutputPerceptrons?.ForEach(p => p.Synaptics.Add(new Synaptic(inputPerceptron)));
            }
        }
Beispiel #2
0
        public void AddOutputPerceptron(string id, out Perceptron perceptron)
        {
            if (OutputPerceptrons == null)
            {
                OutputPerceptrons = new List <Perceptron>();
            }
            perceptron = OutputPerceptrons.SingleOrDefault(p => p.Id == id);
            if (perceptron == null)
            {
                Perceptron outputPerceptron = perceptron = new Perceptron()
                {
                    Id = id, Synaptics = new List <Synaptic>()
                };
                OutputPerceptrons.Add(outputPerceptron);

                InputPerceptrons?.ForEach(p => outputPerceptron.Synaptics.Add(new Synaptic(p)));
            }
        }
Beispiel #3
0
 internal Synaptic(Perceptron perceptron)
 {
     Perceptron   = perceptron;
     PerceptronId = perceptron.Id;
     Weight       = (float)rnd.NextDouble();
 }