|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.functions.neural.NeuralConnection
Abstract unit in a NeuralNetwork.
Field Summary | |
static int |
CONNECTED
This flag is set once the unit has a connection. |
static int |
INPUT
This unit is an input unit. |
static int |
OUTPUT
This unit is an output unit. |
static int |
PURE_INPUT
This unit is a pure input unit. |
static int |
PURE_OUTPUT
This unit is a pure output unit. |
static int |
UNCONNECTED
This unit is not connected to any others. |
Constructor Summary | |
NeuralConnection(java.lang.String id)
Constructs The unit with the basic connection information prepared for use. |
Method Summary | |
static boolean |
connect(NeuralConnection s,
NeuralConnection t)
Connects two units together. |
static boolean |
disconnect(NeuralConnection s,
NeuralConnection t)
Disconnects two units. |
void |
drawHighlight(java.awt.Graphics g,
int w,
int h)
Call this function to draw the node highlighted. |
void |
drawInputLines(java.awt.Graphics g,
int w,
int h)
Call this function to draw the nodes input connections. |
void |
drawNode(java.awt.Graphics g,
int w,
int h)
Call this function to draw the node. |
void |
drawOutputLines(java.awt.Graphics g,
int w,
int h)
Call this function to draw the nodes output connections. |
abstract double |
errorValue(boolean calculate)
Call this to get the error value of this unit. |
java.lang.String |
getId()
|
int[] |
getInputNums()
Use this to get easy access to the input numbers. |
NeuralConnection[] |
getInputs()
Use this to get easy access to the inputs. |
int |
getNumInputs()
|
int |
getNumOutputs()
|
int[] |
getOutputNums()
Use this to get easy access to the output numbers. |
NeuralConnection[] |
getOutputs()
Use this to get easy access to the outputs. |
int |
getType()
|
double |
getX()
|
double |
getY()
|
boolean |
onUnit(java.awt.Graphics g,
int x,
int y,
int w,
int h)
Call this function to determine if the point at x,y is on the unit. |
abstract double |
outputValue(boolean calculate)
Call this to get the output value of this unit. |
void |
removeAllInputs()
This function will remove all the inputs to this unit. |
void |
removeAllOutputs()
This function will remove all outputs to this unit. |
abstract void |
reset()
Call this to reset the unit for another run. |
void |
setType(int t)
|
void |
setX(double x)
|
void |
setY(double y)
|
void |
updateWeights(double l,
double m)
Call this function to update the weight values at this unit. |
double |
weightValue(int n)
Call this to get the weight value on a particular connection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNCONNECTED
public static final int PURE_INPUT
public static final int PURE_OUTPUT
public static final int INPUT
public static final int OUTPUT
public static final int CONNECTED
Constructor Detail |
public NeuralConnection(java.lang.String id)
Method Detail |
public java.lang.String getId()
public int getType()
public void setType(int t)
t
- The new type of this unit.public abstract void reset()
public abstract double outputValue(boolean calculate)
calculate
- True if the value should be calculated if it hasn't been
already.
public abstract double errorValue(boolean calculate)
calculate
- True if the value should be calculated if it hasn't been
already.
public double weightValue(int n)
n
- The connection number to get the weight for, -1 if The threshold
weight should be returned.
public void updateWeights(double l, double m)
l
- The learning Rate to use.m
- The momentum to use.public NeuralConnection[] getInputs()
public NeuralConnection[] getOutputs()
public int[] getInputNums()
public int[] getOutputNums()
public double getX()
public double getY()
public void setX(double x)
x
- The new value for it's x pos.public void setY(double y)
y
- The new value for it's y pos.public boolean onUnit(java.awt.Graphics g, int x, int y, int w, int h)
g
- The graphics context for font size info.x
- The x coord.y
- The y coord.w
- The width of the display.h
- The height of the display.
public void drawNode(java.awt.Graphics g, int w, int h)
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.public void drawHighlight(java.awt.Graphics g, int w, int h)
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.public void drawInputLines(java.awt.Graphics g, int w, int h)
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.public void drawOutputLines(java.awt.Graphics g, int w, int h)
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.public void removeAllInputs()
public void removeAllOutputs()
public int getNumInputs()
public int getNumOutputs()
public static boolean connect(NeuralConnection s, NeuralConnection t)
s
- The source unit.t
- The target unit.
public static boolean disconnect(NeuralConnection s, NeuralConnection t)
s
- The source unit.t
- The target unit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London