Ejemplo n.º 1
0
        public List <double> GetWeigths(int neuronIndex, out LSTMCell.LSTMWeigths lstmWeigths, out double recurrent)
        {
            lstmWeigths = null;
            recurrent   = double.NaN;
            List <double> output;
            int           arrayIndex = NeuronsInfo[neuronIndex].ArrayIndex;

            switch (NeuronsInfo[neuronIndex].neuronType)
            {
            case NeuronTypes.feedForward:
                output = Neurons[arrayIndex].Weigths;
                break;

            case NeuronTypes.lSTM:
                output      = LSTMCells[arrayIndex].Weigths;
                lstmWeigths = LSTMCells[arrayIndex].recurrent;
                break;

            case NeuronTypes.recurrent:
                output    = RecurrentNeurons[arrayIndex].Weigths;
                recurrent = RecurrentNeurons[arrayIndex].recurrentWeigth;
                break;

            default:
                throw new NotImplementedException();
            }
            return(output);
        }
Ejemplo n.º 2
0
 internal NeuronValues(NeuronTypes NeuronType, List <double> weigths, LSTMCell.LSTMWeigths lstmWeigths, double recurrentWeigth)
 {
     this.NeuronType      = NeuronType;
     this.weigths         = weigths;
     this.lstmWeigths     = lstmWeigths;
     this.recurrentWeigth = recurrentWeigth;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Generate random weigths
        /// </summary>
        public NeuronValues(int previousLayerLenght, NeuronTypes neuronType)
        {
            weigths = GenerateRandomWeigths(previousLayerLenght);
            switch (neuronType)
            {
            case NeuronTypes.feedForward:
                break;

            case NeuronTypes.lSTM:
                lstmWeigths = new LSTMCell.LSTMWeigths(previousLayerLenght);
                break;

            case NeuronTypes.recurrent:
                recurrentWeigth = GenerateRandomWeigth();
                break;

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 4
0
 internal NeuronValues(NeuronTypes neuronTypes)
 {
     this.NeuronType = neuronTypes;
     weigths         = new List <double>();
     lstmWeigths     = new LSTMCell.LSTMWeigths();
 }