Jannis (0.1preAlpha) | ||
Prev Class | Next Class | Frames | No Frames | |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
de.webdings.jannis.neuralnet.Neuron
public abstract class Neuron
extends java.lang.Object
Field Summary | |
protected float |
|
protected Synapse[] |
|
protected boolean |
|
protected float |
|
protected int |
|
protected boolean |
|
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
float |
|
String | |
Synapse[] | |
float |
|
int | |
boolean | |
boolean |
|
void |
|
void |
|
void |
|
boolean |
|
protected float a
activation a of the neuron. Can be used in calculations for the activation funtion.
protected Synapse[] connections
connections is an array containing all outgoingsynaptical
connections of this neuron.
protected boolean fired
fired returns true if the neuron has fired during the last time the net was presented with input.
protected int numberOfConnections
numberOfConnections
represents the amount of outgoing connections of this neuron. It is identical to the size ofconnections
protected boolean shouldHaveFired
shouldHaveFired can be used by learning methods. Teacher) uses it, for example.
public Neuron()
Constructs a Neuron with default values:
a=0
net=0
fired=false
shouldHaveFired=false
numberOfConnections=0
public void addConnection(Neuron target)
connects this neuron with another one (target) by constructing a newSynapse
with a randomly generated weight ranging from -0.2 and +0.2
- Parameters:
target
- the target neuron
public void addConnection(Neuron target, float weight)
connects this neuron with another one (target) by constructing a newSynapse
with the specified weight.
- Parameters:
target
- the target neuronweight
- weight of the synaptical connection
public void addConnection(Synapse synapse)
Adds a existingSynapse
to the connections of this neuron.
- Parameters:
synapse
- theSynapse
to add
public void clear()
Sets all attributes (exclusive connections and numberOfConnections) back to default: a=0
net=0
fired=false
shouldHaveFired=false
public void gatherActivation(float weight)
Gathers the net input.
- Parameters:
weight
-
public String getActivationFunction()
- Returns:
- a String representation of the activation function implemented in
tresholdReached()
public void setConnections(Synapse connections)
- Parameters:
connections
- The connections to set.
public void setShouldHaveFired(boolean shouldHaveFired)
- Parameters:
shouldHaveFired
- The shouldHaveFired to set.
public boolean tresholdReached()
represents the activations function of the neuron. This is an abstract method that must be replaced by any concrete subclass of Neuron.
The simplest concrete implementation of this method is a "binary treshold function" (a treshold value) found inBiNeuron
.
- Returns:
- true if the treshold is reached.
This file is part of Jannis.
Jannis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Jannis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Jannis; if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Jannis (0.1preAlpha) |
© 2005 by Stefan Thesing;
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.