Example #1
0
        /// <summary>
        /// Обновить слои.
        /// </summary>
        /// <param name="outputLayer">Выходной слой.</param>
        /// <param name="hiddenLayer">Скрытый слой.</param>
        /// <param name="convolutionalLayer">Свёрточный слой.</param>
        /// <param name="inputLayer">Входной слой.</param>
        /// <param name="currentIteration">Текущая итерация.</param>
        private void LayersUpdate(OutputLayer outputLayer, HiddenLayer hiddenLayer,
                                  ConvolutionalLayer convolutionalLayer, InputLayer inputLayer, int currentIteration)
        {
            inputLayer.UpdateInputData(_dataSets[currentIteration]);
            convolutionalLayer.UpdateData(FilterCoreModel.GetCore, inputLayer.GetLayerNeurons());

            var inputsToHiddenLayer = new List <double>();

            convolutionalLayer.GetLayerNeurons().ForEach(neuron =>
                                                         inputsToHiddenLayer.Add(neuron.Output));

            hiddenLayer.UpdateNeuronsInputs(inputsToHiddenLayer);

            var inputsToOutputLayer = new List <double>();

            hiddenLayer.GetLayerNeurons().ForEach(neuron =>
                                                  inputsToOutputLayer.Add(neuron.Output));

            outputLayer.UpdateNeuronInputs(inputsToOutputLayer);
        }