public interface GraphVertex
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
canDoBackward()
Whether the GraphVertex can do backward pass.
|
boolean |
canDoForward()
Whether the GraphVertex can do forward pass.
|
void |
clear()
Clear the internal state (if any) of the GraphVertex.
|
Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray[]> |
doBackward(boolean tbptt)
Do backward pass
|
org.nd4j.linalg.api.ndarray.INDArray |
doForward(boolean training)
Do forward pass using the stored inputs
|
Pair<org.nd4j.linalg.api.ndarray.INDArray,MaskState> |
feedForwardMaskArrays(org.nd4j.linalg.api.ndarray.INDArray[] maskArrays,
MaskState currentMaskState,
int minibatchSize) |
org.nd4j.linalg.api.ndarray.INDArray |
getEpsilon()
Get the epsilon/error (i.e., dL/dOutput) array previously set for this GraphVertex
|
org.nd4j.linalg.api.ndarray.INDArray[] |
getInputs()
Get the array of inputs previously set for this GraphVertex
|
VertexIndices[] |
getInputVertices()
A representation of the vertices that are inputs to this vertex (inputs duing forward pass)
Specifically, if inputVertices[X].getVertexIndex() = Y, and inputVertices[X].getVertexEdgeNumber() = Z then the Zth output connection (see getNumOutputConnections() of vertex Y is the Xth input to this vertex |
Layer |
getLayer()
Get the Layer (if any).
|
int |
getNumInputArrays()
Get the number of input arrays.
|
int |
getNumOutputConnections()
Get the number of outgoing connections from this GraphVertex.
|
VertexIndices[] |
getOutputVertices()
A representation of the vertices that this vertex is connected to (outputs duing forward pass)
Specifically, if outputVertices[X].getVertexIndex() = Y, and outputVertices[X].getVertexEdgeNumber() = Z
then the Xth output of this vertex is connected to the Zth input of vertex Y
|
int |
getVertexIndex()
Get the index of the GraphVertex
|
java.lang.String |
getVertexName()
Get the name/label of the GraphVertex
|
boolean |
hasLayer()
Whether the GraphVertex contains a
Layer object or not |
boolean |
isInputVertex()
Whether the GraphVertex is an input vertex
|
boolean |
isOutputVertex()
Whether the GraphVertex is an output vertex
|
void |
setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
|
void |
setEpsilon(org.nd4j.linalg.api.ndarray.INDArray epsilon)
Set the errors (epsilon - aka dL/dActivation) for this GraphVertex
|
void |
setInput(int inputNumber,
org.nd4j.linalg.api.ndarray.INDArray input)
Set the input activations.
|
void |
setInputs(org.nd4j.linalg.api.ndarray.INDArray... inputs)
Set all inputs for this GraphVertex
|
void |
setInputVertices(VertexIndices[] inputVertices)
Sets the input vertices.
|
void |
setLayerAsFrozen()
Only applies to layer vertices.
|
void |
setOutputVertices(VertexIndices[] outputVertices)
set the output vertices.
|
java.lang.String getVertexName()
int getVertexIndex()
int getNumInputArrays()
int getNumOutputConnections()
VertexIndices[] getInputVertices()
getNumOutputConnections()
of vertex Y is the Xth input to this vertexvoid setInputVertices(VertexIndices[] inputVertices)
getInputVertices()
VertexIndices[] getOutputVertices()
void setOutputVertices(VertexIndices[] outputVertices)
getOutputVertices()
boolean hasLayer()
Layer
object or notboolean isInputVertex()
boolean isOutputVertex()
Layer getLayer()
hasLayer()
== falsevoid setInput(int inputNumber, org.nd4j.linalg.api.ndarray.INDArray input)
inputNumber
- Must be in range 0 to getNumInputArrays()
-1input
- The input arrayvoid setEpsilon(org.nd4j.linalg.api.ndarray.INDArray epsilon)
void clear()
boolean canDoForward()
boolean canDoBackward()
org.nd4j.linalg.api.ndarray.INDArray doForward(boolean training)
training
- if true: forward pass at training time. If false: forward pass at test timePair<Gradient,org.nd4j.linalg.api.ndarray.INDArray[]> doBackward(boolean tbptt)
tbptt
- If true: do backprop using truncated BPTTorg.nd4j.linalg.api.ndarray.INDArray[] getInputs()
org.nd4j.linalg.api.ndarray.INDArray getEpsilon()
void setInputs(org.nd4j.linalg.api.ndarray.INDArray... inputs)
setInput(int, INDArray)
void setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
backpropGradientsViewArray
- Pair<org.nd4j.linalg.api.ndarray.INDArray,MaskState> feedForwardMaskArrays(org.nd4j.linalg.api.ndarray.INDArray[] maskArrays, MaskState currentMaskState, int minibatchSize)
void setLayerAsFrozen()