saaps.network
Class Neuron
java.lang.Object
|
+--saaps.network.Neuron
- public class Neuron
- extends java.lang.Object
The Neuron class is the smallest building block of
a network. A neuron is defined by the weights, the
bias and the activation function. The activation
functions currently supported are
- PURELIN: y=x ,
- LOGSIG: y=1/(1+exp(-x)) ,
- TANSIG: y=2/(1+exp(-2x))-1 .
- Version:
- 2000-01-18
- Author:
- Peter Wintoft
Constructor Summary |
Neuron(Jama.Matrix w,
double b)
The neuron is created from the weights andthe bias using
the default activation function (TANSIG). |
Neuron(Jama.Matrix w,
double b,
int af)
The neuron is created from the weights, the bias and
the activation function. |
Method Summary |
Jama.Matrix |
getOutput()
Get the output. |
Jama.Matrix |
sim(Jama.Matrix input)
Run the network on an input matrix. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
weight
private Jama.Matrix weight
bias
private double bias
actFun
private int actFun
output
private Jama.Matrix output
PURELIN
public static final int PURELIN
LOGSIG
public static final int LOGSIG
TANSIG
public static final int TANSIG
Neuron
public Neuron(Jama.Matrix w,
double b,
int af)
- The neuron is created from the weights, the bias and
the activation function.
- Parameters:
w
- weightsb
- biasaf
- activation function (PURELIN, LOGSIG or TANSIG)
Neuron
public Neuron(Jama.Matrix w,
double b)
- The neuron is created from the weights andthe bias using
the default activation function (TANSIG).
- Parameters:
w
- weightsb
- bias
sim
public Jama.Matrix sim(Jama.Matrix input)
- Run the network on an input matrix. The number of rows should
equal the number of inputs. Each column represents one example,
and the output will have as many columns as the input.
- Parameters:
input
- input matrix
getOutput
public Jama.Matrix getOutput()
- Get the output.