|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.engine.Layer
org.joone.structure.NetworkLayer
public class NetworkLayer
Wraps an existing joone network into a single layer. Probably should use something like a Synapse subclass in stead. Will probably run into trouble using Layer, which has a fixed number of input and output rows. Synapse at least has different input and outputs. Maybe should just implement input and output pattern listener.... Will revisit at some stage in the future, for now, Layer at least allows for easy testing. Joone treats input layers funny in that it adds a randomly initialised bias to the input before passing it on. Thus if you use a tanh layer and have say 3 inputs, y1, y2 and y3, then the values passed on to the next (hidden) layer will be [ tanh( y1 + b1 ), tanh( y2 + b2 ), tanh( y3 + b3 ) ] where b1 .. b3 are (random) biases. At the node level, we need more nodes to properly cater for this. New nodes z1 .. z3 are formed where z1 = y1 + b1 or, if e.g. a tanh layer, then z1 = tanh( y1 + b1 ). Thus z1 is a new node, fed from two connections, the first to the actual input and the next to the bias.
Field Summary | |
---|---|
protected java.util.List<ContextNode> |
contextNodes
List of all context nodes |
protected boolean |
fixed
True if context node are in fixed state - useful when simulating |
protected java.util.List<InputNode> |
inputNodes
List of input nodes |
protected DirectSynapse |
inputSynapse
Synapse used to interrogate network |
protected java.util.List<Node> |
nodeList
List of all nodes |
protected java.util.List<java.util.List<Node>> |
orderedNodes
Ordered nodes |
protected java.util.List<Node> |
outputNodes
List of output nodes |
protected int |
patternCount
Pattern counter |
Fields inherited from class org.joone.engine.Layer |
---|
bias, gradientInps, gradientOuts, inps, inputPatternListeners, learnable, learning, m_batch, monitor, myLearner, outputPatternListeners, outs, running, step, STOP_FLAG |
Constructor Summary | |
---|---|
NetworkLayer(NeuralNet network)
Constructor |
Method Summary | |
---|---|
protected void |
backward(double[] pattern)
Reverse transfer function of the component. |
protected void |
forward(double[] pattern)
Transfer function to recall a result on a trained net |
java.util.List<ContextNode> |
getContextNodes()
Return a list of all context nodes |
double |
getDefaultState()
Return the default state of a node in this layer, such as 0 for a tanh or 0.5 for a sigmoid layer |
double |
getDerivative(int i)
Return the derivative with respect to the function value at a given index. |
java.util.List<InputNode> |
getInputNodes()
Return a list of all input nodes |
double |
getMaximumState()
Return maximum value of a node in this layer |
double |
getMinimumState()
Return minimum value of a node in this layer |
java.util.List<Node> |
getNodeList()
Return a list of all nodes |
java.util.List<java.util.List<Node>> |
getOrderedNodes()
Return the ordered nodes |
java.util.List<Node> |
getOutputNodes()
Return a list of output nodes |
double[] |
interrogate(double[] pattern)
Interrogate the net |
boolean |
isFixed()
See if the network is currently in fixed state |
static void |
main(java.lang.String[] args)
Test |
protected void |
setDimensions()
Sets the dimension of the layer. |
void |
setFixed(boolean fixed)
Set state of context nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Node> nodeList
protected java.util.List<InputNode> inputNodes
protected java.util.List<Node> outputNodes
protected java.util.List<ContextNode> contextNodes
protected java.util.List<java.util.List<Node>> orderedNodes
protected boolean fixed
protected int patternCount
protected DirectSynapse inputSynapse
Constructor Detail |
---|
public NetworkLayer(NeuralNet network)
Method Detail |
---|
public double getDefaultState()
Layer
getDefaultState
in class Layer
public double getMinimumState()
Layer
getMinimumState
in class Layer
public double getMaximumState()
Layer
getMaximumState
in class Layer
protected void backward(double[] pattern) throws JooneRuntimeException
Layer
backward
in class Layer
pattern
- input pattern on which to apply the transfer function
JooneRuntimeException
protected void forward(double[] pattern) throws JooneRuntimeException
Layer
forward
in class Layer
pattern
- input pattern to which to apply the rtransfer function
JooneRuntimeException
protected void setDimensions()
Layer
setDimensions
in class Layer
public double getDerivative(int i)
Layer
getDerivative
in class Layer
public void setFixed(boolean fixed)
public boolean isFixed()
public double[] interrogate(double[] pattern)
public static void main(java.lang.String[] args)
public java.util.List<Node> getNodeList()
public java.util.List<InputNode> getInputNodes()
public java.util.List<Node> getOutputNodes()
public java.util.List<ContextNode> getContextNodes()
public java.util.List<java.util.List<Node>> getOrderedNodes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |