2015-03-23 20:58:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class Neuron
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
double outputValue;
|
|
|
|
std::vector<double> outputWeights;
|
2015-10-15 20:16:34 +00:00
|
|
|
double gradient;
|
2015-03-23 20:58:30 +00:00
|
|
|
|
|
|
|
public:
|
2015-03-24 12:45:38 +00:00
|
|
|
Neuron(double value = 1.0);
|
|
|
|
|
2015-03-23 20:58:30 +00:00
|
|
|
void setOutputValue(double value);
|
|
|
|
static double transferFunction(double inputValue);
|
|
|
|
static double transferFunctionDerivative(double inputValue);
|
|
|
|
void feedForward(double inputValue);
|
2015-03-24 12:45:38 +00:00
|
|
|
double getWeightedOutputValue(unsigned int outputNeuron) const;
|
2015-10-15 17:18:26 +00:00
|
|
|
void createRandomOutputWeights(unsigned int numberOfWeights);
|
2015-03-23 20:58:30 +00:00
|
|
|
double getOutputValue() const;
|
2015-10-15 20:16:34 +00:00
|
|
|
|
|
|
|
void calcOutputGradients(double targetValue);
|
|
|
|
//void calcHiddenGradients(const Layer &prevLayer);
|
2015-03-23 20:58:30 +00:00
|
|
|
};
|