A neuron in a Layer of a NeuralNet. More...
#include <Neuron.h>
Public Member Functions | |
Neuron (int numInputs) | |
Constructs a neuron with randomly assigned weights. More... | |
Neuron (std::vector< double > w) | |
Constructs a neuron with given weights. More... | |
double | getOutput (std::vector< double > inputs) |
Gets outputs of neuron from given inputs. More... | |
void | randomizeWeights () |
Randomizes the weights of the neuron. More... | |
Static Public Member Functions | |
static double | randomWeight () |
Generates a random input weight. More... | |
Public Attributes | |
std::vector< double > | weights |
Set of weights for the Neuron object. More... | |
A neuron in a Layer of a NeuralNet.
Each neuron takes a variable number of inputs each assigned a weight and returns one output. Each neuron has a threshold value used to determine if an output is produced (or to determine the magnitude of the neuron's output). A quality class by all accounts.
|
explicit |
Constructs a neuron with randomly assigned weights.
Each weight is a random double between 0 and 1.
numInputs | the number of inputs to the neuron |
|
explicit |
Constructs a neuron with given weights.
w | the input weights from which to construct the neuron. |
double Neuron::getOutput | ( | std::vector< double > | inputs | ) |
Gets outputs of neuron from given inputs.
The last weight is the threshold, as documented here.
void Neuron::randomizeWeights | ( | ) |
Randomizes the weights of the neuron.
|
inlinestatic |
Generates a random input weight.
std::vector<double> net::Neuron::weights |
Set of weights for the Neuron object.