This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
Neuro/Neuron.h

32 lines
686 B
C
Raw Normal View History

#pragma once
#include <vector>
class Layer;
class Neuron
{
private:
double outputValue;
std::vector<double> outputWeights;
double gradient;
public:
2015-03-24 12:45:38 +00:00
Neuron(double value = 1.0);
void setOutputValue(double value);
void feedForward(double inputValue);
2015-03-24 12:45:38 +00:00
double getWeightedOutputValue(unsigned int outputNeuron) const;
2015-10-15 20:37:13 +00:00
void createRandomOutputWeights(size_t numberOfWeights);
double getOutputValue() const;
void calcOutputGradients(double targetValue);
void calcHiddenGradients(const Layer &nextLayer);
private:
static double transferFunction(double inputValue);
static double transferFunctionDerivative(double inputValue);
double sumDOW(const Layer &nextLayer) const;
};