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); }
internal NeuronValues(NeuronTypes NeuronType, List <double> weigths, LSTMCell.LSTMWeigths lstmWeigths, double recurrentWeigth) { this.NeuronType = NeuronType; this.weigths = weigths; this.lstmWeigths = lstmWeigths; this.recurrentWeigth = recurrentWeigth; }
/// <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(); } }
internal NeuronValues(NeuronTypes neuronTypes) { this.NeuronType = neuronTypes; weigths = new List <double>(); lstmWeigths = new LSTMCell.LSTMWeigths(); }