Esempio n. 1
0
        public ANNLayer(int inputs, int neurons, IANNActivation fun)
        {
            m_InputCount  = inputs;
            m_NeuronCount = neurons;
            m_Neurons     = new ANNNeuron[m_NeuronCount];
            m_Gradients   = new double[m_NeuronCount];

            for (int i = 0; i < m_NeuronCount; i++)
            {
                m_Neurons[i] = new ANNNeuron(m_InputCount, fun);
            }
        }
Esempio n. 2
0
        //public int m_InputCount;
        //public int m_NeuronCount;
        //public ANNNeuron[] m_Neurons;
        //public double[] m_output;
        //public double[] m_Gradients;

        public SoftmaxLayer(int inputs, int neurons, IANNActivation fun)
        {
            m_InputCount  = inputs;
            m_NeuronCount = neurons;
            m_Neurons     = new ANNNeuron[m_NeuronCount];
            m_Gradients   = new double[m_NeuronCount];

            if (fun == null)
            {
                fun = new Linear();
            }

            for (int i = 0; i < m_NeuronCount; i++)
            {
                m_Neurons[i] = new ANNNeuron(m_InputCount, fun);
            }
        }