Fido
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
net::Neuron Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

Neuron::Neuron ( int  numInputs)
explicit

Constructs a neuron with randomly assigned weights.

Each weight is a random double between 0 and 1.

Parameters
numInputsthe number of inputs to the neuron
Neuron::Neuron ( std::vector< double >  w)
explicit

Constructs a neuron with given weights.

Parameters
wthe input weights from which to construct the neuron.

Member Function Documentation

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.

static double net::Neuron::randomWeight ( )
inlinestatic

Generates a random input weight.

Returns
A random double between zero and one.

Member Data Documentation

std::vector<double> net::Neuron::weights

Set of weights for the Neuron object.


The documentation for this class was generated from the following files: