Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void NeuralNetwork::FeedForwardNN()
- {
- // OBSOLETE
- for (int hiddenIndex = 0; hiddenIndex < m_hiddenLayers->m_neurons.size(); hiddenIndex++)
- {
- double sum = 0;
- for (int index = 0; index < m_inputs->m_neurons.size(); index++)
- {
- sum += (m_inputs->m_neurons.at(index).m_value)*(m_inputs->m_neurons.at(index).m_weights.at(hiddenIndex));
- }
- //sum += m_inputs->m_bias.m_value * m_inputs->m_bias.m_weights.at(hiddenIndex);
- m_hiddenLayers->m_neurons.at(hiddenIndex).m_sumOfPreviousLayer = sum;
- m_hiddenLayers->m_neurons.at(hiddenIndex).m_value = GetActivationValue(sum);
- }
- for (int outputIndex = 0; outputIndex < m_outputs->m_neurons.size(); outputIndex++)
- {
- double sum = 0;
- for (int hiddenIndex = 0; hiddenIndex < m_hiddenLayers->m_neurons.size(); hiddenIndex++)
- {
- sum += (m_hiddenLayers->m_neurons.at(hiddenIndex).m_value)*(m_hiddenLayers->m_neurons.at(hiddenIndex).m_weights.at(outputIndex));
- }
- //sum += m_hiddenLayers->m_bias.m_value * m_hiddenLayers->m_bias.m_weights.at(outputIndex);
- m_outputs->m_neurons.at(outputIndex).m_sumOfPreviousLayer = sum;
- m_outputs->m_neurons.at(outputIndex).m_value = GetActivationValue(sum);
- }
- }
Add Comment
Please, Sign In to add comment