Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Neuron Class Reference

The baseclass of neurons in ANNetwork. More...

#include <neuron.h>

Inheritance diagram for Neuron:

BiNode List of all members.

Public Types

enum  unitTypes
enum  tfuncs

Public Methods

virtual void init (double r=0.0)
void reset ()
virtual void transfer (ANNetwork &net)
double activation () const
virtual void setActivation (double a)
void operator= (double a)
virtual double output () const
 operator const double () const
double bias () const
void setBias (double b)
int getType () const
void setType (int t)
int transferFunc () const
void setTFunc (int f)
void enable (bool s=true)
bool isEnabled () const
void copy (const Neuron &orig)
virtual Neuron * clone () const
virtual void check (int netSize) const

Protected Attributes

double mActivation
Connection mBias
int mType
int mTransferFunc
bool mExists

Friends

class NeuronContainer

Detailed Description

The baseclass of neurons in ANNetwork.

Somewhat bloated.

It handles signal transmission in reading manner (connections point to source units).

Definition at line 199 of file neuron.h.


Member Enumeration Documentation

enum tfuncs
 

Transfer functions.

Definition at line 317 of file neuron.h.

enum unitTypes
 

Neuron types: is neuron input, hidden or output unit.

Definition at line 314 of file neuron.h.


Member Function Documentation

double activation   const [inline]
 

Returns the activation value.

Unless overloaded, this value is identical with the Neuron::output() value.

See also:
Neuron::output

Definition at line 230 of file neuron.h.

References mActivation.

Referenced by transfer().

double bias   const [inline]
 

Returns the current bias (threshold) value of the neuron.

Definition at line 253 of file neuron.h.

References mBias, and Connection::weight().

void check int    netSize const [virtual]
 

Implementation for Object.

Reimplemented from BiNode.

Definition at line 275 of file neuron.cc.

References BiNode::check(), Connection::check(), mActivation, mBias, mTransferFunc, and mType.

Referenced by ANNetwork::check().

virtual Neuron* clone   const [inline, virtual]
 

Implementation for Object.

Definition at line 305 of file neuron.h.

Referenced by ANNetwork::copyFreeNet().

void copy const Neuron &    orig
 

Standard copy operator.

Definition at line 239 of file neuron.cc.

References Connection::copy(), BiNode::copy(), mActivation, mBias, mExists, mTransferFunc, and mType.

void enable bool    s = true [inline]
 

Enables (true) or disables (false) the neuron.

If the neuron is disabled, it's Neuron::output() value will always be 0.0. It will also (practically) not use any computational resources.

See also:
Neuron::isEnabled()

Definition at line 291 of file neuron.h.

References mExists.

int getType   const [inline]
 

Returns the type of the neuron; is it an input, hidden or output unit.

See Neuron::unitTypes for information on the possible values.

Definition at line 264 of file neuron.h.

References mType.

void init double    r = 0.0 [virtual]
 

Initialize weights and bias to random value in given range.

Definition at line 252 of file neuron.cc.

References BiNode::incomings(), Connection::init(), and mBias.

Referenced by GaussianInitializer::initialize().

bool isEnabled   const [inline]
 

Returns the enabledness state of the neuron.

See also:
Neuron::enable()

Definition at line 297 of file neuron.h.

References mExists.

Referenced by ANNetwork::drawEPS().

operator const double   const [inline]
 

Returns the output value of the neuron.

See also:
Neuron::output

Definition at line 250 of file neuron.h.

References mActivation.

void operator= double    a [inline]
 

Sets the activation value of the neuron.

Definition at line 236 of file neuron.h.

References mActivation.

virtual double output   const [inline, virtual]
 

Returns the output value of the neuron.

Unless overloaded, this value is identical with the Neuron::activation() value.

See also:
Neuron::activation

Definition at line 244 of file neuron.h.

References mActivation.

Referenced by Connection::transfer().

void reset   [inline]
 

Resets activation (and other possible dynamic states) to 0.0.

Definition at line 213 of file neuron.h.

References mActivation.

virtual void setActivation double    a [inline, virtual]
 

Sets the activation value of the neuron.

Definition at line 233 of file neuron.h.

References mActivation.

void setBias double    b [inline]
 

Sets the bias (threshold value of the neuron to the given value.

Definition at line 256 of file neuron.h.

References mBias.

void setTFunc int    f [inline]
 

Sets the transfer function ID of the neuron.

See Neuron::tfuncs for information about the different functions.

Definition at line 282 of file neuron.h.

References mTransferFunc.

void setType int    t [inline]
 

Sets the type of the neuron; is it an input, hidden or output unit.

See Neuron::unitTypes for information on the possible values. This information is typically not very important.

Definition at line 270 of file neuron.h.

References mType.

void transfer ANNetwork   net [virtual]
 

Updates the unit by transferring signals through the connections.

Parameters:
net  The owner of the neuron, because it doesn't know it otherwise.

Definition at line 261 of file neuron.cc.

References activation(), BiNode::incomings(), mActivation, mBias, Connection::source(), and Connection::weight().

int transferFunc   const [inline]
 

Returns the transfer function ID of the neuron.

See Neuron::tfuncs for information about the different functions.

Definition at line 276 of file neuron.h.

References mTransferFunc.

Referenced by ANNetwork::drawEPS().


Member Data Documentation

double mActivation [protected]
 

Activation value of the unit.

Definition at line 322 of file neuron.h.

Referenced by activation(), check(), copy(), operator const double(), operator=(), output(), reset(), setActivation(), and transfer().

Connection mBias [protected]
 

Bias (threshold).

Definition at line 325 of file neuron.h.

Referenced by bias(), check(), copy(), init(), setBias(), and transfer().

bool mExists [protected]
 

Does this unit really exist or not (is it active or dormant).

Definition at line 334 of file neuron.h.

Referenced by copy(), enable(), and isEnabled().

int mTransferFunc [protected]
 

Transfer function type (or -1 if default).

Definition at line 331 of file neuron.h.

Referenced by check(), copy(), setTFunc(), and transferFunc().

int mType [protected]
 

Unit type (see unitTypes).

Definition at line 328 of file neuron.h.

Referenced by check(), copy(), getType(), and setType().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:06:45 2005 for Inanna by doxygen1.2.18