weka.classifiers.neural
Class NeuralNetwork.NeuralEnd
java.lang.Object
|
+--weka.classifiers.neural.NeuralConnection
|
+--weka.classifiers.neural.NeuralNetwork.NeuralEnd
- All Implemented Interfaces:
- java.io.Serializable
- Enclosing class:
- NeuralNetwork
- protected class NeuralNetwork.NeuralEnd
- extends NeuralConnection
This inner class is used to connect the nodes in the network up to
the data that they are classifying, Note that objects of this class are
only suitable to go on the attribute side or class side of the network
and not both.
- See Also:
- Serialized Form
Fields inherited from class weka.classifiers.neural.NeuralConnection |
CONNECTED, INPUT, m_id, m_inputList, m_inputNums, m_numInputs, m_numOutputs, m_outputList, m_outputNums, m_type, m_unitError, m_unitValue, m_weightsUpdated, m_x, m_y, OUTPUT, PURE_INPUT, PURE_OUTPUT, UNCONNECTED |
Method Summary |
void |
drawHighlight(java.awt.Graphics g,
int w,
int h)
Call this function to draw the node highlighted. |
void |
drawNode(java.awt.Graphics g,
int w,
int h)
This will draw the node id to the graphics context. |
double |
errorValue(boolean calculate)
Call this to get the error value of this unit, which in this case is
the difference between the predicted class, and the actual class. |
int |
getLink()
|
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. |
double |
outputValue(boolean calculate)
Call this to get the output value of this unit. |
void |
reset()
Call this to reset the value and error for this unit, ready for the next
run. |
void |
setLink(boolean input,
int val)
Call this function to set What this end unit represents. |
Methods inherited from class weka.classifiers.neural.NeuralConnection |
allocateInputs, allocateOutputs, changeInputNum, changeOutputNum, connect, connectInput, connectOutput, disconnect, disconnectInput, disconnectOutput, drawInputLines, drawOutputLines, getId, getInputNums, getInputs, getNumInputs, getNumOutputs, getOutputNums, getOutputs, getType, getX, getY, removeAllInputs, removeAllOutputs, setType, setX, setY, updateWeights, weightValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NeuralNetwork.NeuralEnd
public NeuralNetwork.NeuralEnd(java.lang.String id)
onUnit
public 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.
- Overrides:
onUnit
in class NeuralConnection
- Parameters:
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.- Returns:
- True if the point is on the unit, false otherwise.
drawNode
public void drawNode(java.awt.Graphics g,
int w,
int h)
- This will draw the node id to the graphics context.
- Overrides:
drawNode
in class NeuralConnection
- Parameters:
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.
drawHighlight
public void drawHighlight(java.awt.Graphics g,
int w,
int h)
- Call this function to draw the node highlighted.
- Overrides:
drawHighlight
in class NeuralConnection
- Parameters:
g
- The graphics context.w
- The width of the drawing area.h
- The height of the drawing area.
outputValue
public double outputValue(boolean calculate)
- Call this to get the output value of this unit.
- Overrides:
outputValue
in class NeuralConnection
- Parameters:
calculate
- True if the value should be calculated if it hasn't
been already.- Returns:
- The output value, or NaN, if the value has not been calculated.
errorValue
public double errorValue(boolean calculate)
- Call this to get the error value of this unit, which in this case is
the difference between the predicted class, and the actual class.
- Overrides:
errorValue
in class NeuralConnection
- Parameters:
calculate
- True if the value should be calculated if it hasn't
been already.- Returns:
- The error value, or NaN, if the value has not been calculated.
reset
public void reset()
- Call this to reset the value and error for this unit, ready for the next
run. This will also call the reset function of all units that are
connected as inputs to this one.
This is also the time that the update for the listeners will be
performed.
- Overrides:
reset
in class NeuralConnection
setLink
public void setLink(boolean input,
int val)
throws java.lang.Exception
- Call this function to set What this end unit represents.
- Parameters:
input
- True if this unit is used for entering an attribute,
False if it's used for determining a class value.val
- The attribute number or class type that this unit represents.
(for nominal attributes).
getLink
public int getLink()
- Returns:
- link for this node.