|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.structure.NodesAndWeights
public class NodesAndWeights
This class takes a neural network and breaks it up into classified nodes (ie input, output or hidden nodes) and also in the process extracts the weight matrix wij with i being the node fired into and j being the node fired from. It also identifies if an input node has some kind of an initial state that can potentially be considered to be part of the optimisation exercise. This class is useful when presenting the network as a optimisation problem to some canned optimisation algorithm or as a first step towards implementing the RTRL or EKF learning algorithms. In part for performance reasons, many of the members are not wrapped as usual and are accessed directly.
Nested Class Summary | |
---|---|
class |
NodesAndWeights.Node
A node. |
class |
NodesAndWeights.Weight
A weight. |
Field Summary | |
---|---|
java.util.List<NodesAndWeights.Node> |
I
The input nodes, a subset of Z, specifically the last few nodes in Z, that are connected to the input layer. |
int |
inputNodeCount
The number of input nodes, which appear as the final nodes in the Z array |
int |
outputNodeCount
The number of output nodes, which appear as the first nodes in the Z array |
java.util.List<NodesAndWeights.Node> |
S
The nodes that have an initial state. |
java.util.List<NodesAndWeights.Node> |
T
The output nodes, a subset of Z and used to speed up calculations |
java.util.List<NodesAndWeights.Node> |
U
The nodes in U, a subset of Z, specifically the first few nodes in Z, but those that are not input nodes. |
java.util.List<NodesAndWeights.Weight> |
weights
List of all weights, typically used when setting up an optimisation problem |
protected java.util.List<NodesAndWeights.Node> |
z
The unclassified nodes, referred to as the z array |
java.util.List<NodesAndWeights.Node> |
Z
The same as z, but this time classified and ordered so that nodes in U come first. |
Constructor Summary | |
---|---|
NodesAndWeights(NeuralNet network,
double maximumWeightMagnitude,
boolean reset)
Create a new instance of NodesAndWeights, decomposing the given network into nodes, initial states and attached weights |
Method Summary | |
---|---|
protected NodesAndWeights.Weight |
getFixedWeight(NodesAndWeights.Node input,
NodesAndWeights.Node output)
Determine the fixed weight between an input and a output node. |
protected NodesAndWeights.Weight |
getWeight(NodesAndWeights.Node input,
NodesAndWeights.Node output)
Determine the weight between an input and a output node. |
protected void |
init(NeuralNet network,
double maximumWeightMagnitude,
boolean reset)
Initialise the underlying parameters and structures. |
protected boolean |
isFixedLinked(NodesAndWeights.Node input,
NodesAndWeights.Node output)
Determine if there exists a fixed link or weight between two nodes. |
protected boolean |
isLinked(NodesAndWeights.Node input,
NodesAndWeights.Node output)
Determine if there exists a link or weight between two nodes. |
void |
printWeights(java.io.PrintStream out)
Helper function to print out the weight matrix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<NodesAndWeights.Node> z
public java.util.List<NodesAndWeights.Node> Z
public java.util.List<NodesAndWeights.Node> T
public java.util.List<NodesAndWeights.Node> U
public java.util.List<NodesAndWeights.Node> I
public java.util.List<NodesAndWeights.Node> S
public java.util.List<NodesAndWeights.Weight> weights
public int inputNodeCount
public int outputNodeCount
Constructor Detail |
---|
public NodesAndWeights(NeuralNet network, double maximumWeightMagnitude, boolean reset)
network
- network to detanglemaximumWeightMagnitude
- the maximum allowable weight magnitude or 0 for no maximumreset
- if true, will reset all input and context layer biases to zero.
This is a cosmetic step, as these are often randomised but not
used, but may have an impact on networks that use something other
than a linear layer as input layer.Method Detail |
---|
protected boolean isLinked(NodesAndWeights.Node input, NodesAndWeights.Node output)
protected NodesAndWeights.Weight getWeight(NodesAndWeights.Node input, NodesAndWeights.Node output)
protected boolean isFixedLinked(NodesAndWeights.Node input, NodesAndWeights.Node output)
protected NodesAndWeights.Weight getFixedWeight(NodesAndWeights.Node input, NodesAndWeights.Node output)
protected void init(NeuralNet network, double maximumWeightMagnitude, boolean reset)
public void printWeights(java.io.PrintStream out)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |