Neuro/Neuron.h

34 lines
716 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);
2015-10-16 21:23:27 +00:00
double getGradient() const;
private:
static double transferFunction(double inputValue);
static double transferFunctionDerivative(double inputValue);
double sumDOW(const Layer &nextLayer) const;
};