Exemplo n.º 1
0
        public Connection(Neurone a, Neurone b, double weight)
        {
            Dendrite = a;
            Axon     = b;

            Weight = weight;
        }
Exemplo n.º 2
0
        public void MeshWithNextLayer()
        {
            int index = 0;

            for (int i = 0; i < Neurones.Length; i++)
            {
                Neurone current = Neurones[i];
                for (int j = 0; j < NextLayer.Neurones.Length; j++)
                {
                    var weight = Extension.Random.Next(-1000, 1000) * 0.001;
                    if (Parent != null)
                    {
                        weight = _ParentWeights[index++];
                    }

                    current.Connections.Add(new Connection(current, NextLayer.Neurones[j], weight));
                    DNA.AddWeight(weight);
                }
            }
        }
Exemplo n.º 3
0
        public Layer(int n, IActivation f, DNA parent = null)
        {
            NeuroneCount       = n;
            ActivationFunction = f;

            Neurones = new Neurone[n];

            Parent = parent;
            Bias   = Extension.Random.Next(-1000, 1000) * 0.001;
            if (parent != null)
            {
                Bias           = parent.GetBias();
                _ParentWeights = parent.ToWeights();
            }
            DNA = new DNA(Bias);

            for (int i = 0; i < Neurones.Length; i++)
            {
                Neurones[i] = new Neurone(f, Bias);
            }
        }