Exemplo n.º 1
0
        /*public vNeuron(main.Network inNet, List<List<int>> inInputNs, int inLayer, int inDim)
         * {
         *  this.inputNeurons = inInputNs;
         *  this.layer = inLayer;
         *  this.dimension = inDim;
         *
         *  this.weights = new List<List<double>>();
         *  for(int i = 0; i < inNet.NUM_DEPTH; i++)
         *  {
         *      this.weights.Add(Enumerable.Repeat(DEFAULT_WEIGHT, inDim).ToList());
         *  }
         * }*/

        //Input Neuron Constructor
        public vNeuron(List <double> output)
        {
            this.layer     = 0;
            this.actFunc   = actFuncType.identity;
            this.dimension = output.Count;

            this.inputs.Add(new List <double>());
            for (int i = 0; i < this.dimension; i++)
            {
                this.inputs[0].Add(output[i]);
                this.beta.Add(0d);
            }

            this.weights.Add(MyMath.makeIdentityMatrix(this.dimension));
        }
Exemplo n.º 2
0
        //Input Neuron Constructor
        public mNeuron(List <List <double> > output)
        {
            this.layer   = 0;
            this.actFunc = actFuncType.identity;
            int d = 0;

            this.inputs.Add(new List <List <double> >());
            for (int i = 0; i < output.Count; i++)
            {
                d++;
                this.inputs[0].Add(new List <double>());
                this.beta.Add(new List <double>());
                for (int j = 0; j < output[0].Count; j++)
                {
                    this.inputs[0][i].Add(output[i][j]);
                    this.beta[i].Add(0d);
                }
            }

            this.weights.Add(MyMath.makeIdentityMatrix(d));
        }