public class LayerVertex extends BaseGraphVertex
InputPreProcessor) in itepsilon, graph, inputs, inputVertices, outputVertex, outputVertices, vertexIndex, vertexName| Constructor and Description |
|---|
LayerVertex(ComputationGraph graph,
String name,
int vertexIndex,
Layer layer,
InputPreProcessor layerPreProcessor,
boolean outputVertex)
Create a network input vertex:
|
LayerVertex(ComputationGraph graph,
String name,
int vertexIndex,
VertexIndices[] inputVertices,
VertexIndices[] outputVertices,
Layer layer,
InputPreProcessor layerPreProcessor,
boolean outputVertex) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyPreprocessorAndSetInput(LayerWorkspaceMgr workspaceMgr) |
boolean |
canDoBackward()
Whether the GraphVertex can do backward pass.
|
double |
computeScore(double l1,
double l2,
boolean training,
LayerWorkspaceMgr workspaceMgr) |
org.nd4j.linalg.api.ndarray.INDArray |
computeScoreForExamples(double l1,
double l2,
LayerWorkspaceMgr workspaceMgr) |
org.nd4j.linalg.primitives.Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray[]> |
doBackward(boolean tbptt,
LayerWorkspaceMgr workspaceMgr)
Do backward pass
|
org.nd4j.linalg.api.ndarray.INDArray |
doForward(boolean training,
LayerWorkspaceMgr workspaceMgr)
Do forward pass using the stored inputs
|
org.nd4j.linalg.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray,MaskState> |
feedForwardMaskArrays(org.nd4j.linalg.api.ndarray.INDArray[] maskArrays,
MaskState currentMaskState,
int minibatchSize) |
Layer |
getLayer()
Get the Layer (if any).
|
boolean |
hasLayer()
Whether the GraphVertex contains a
Layer object or not |
boolean |
isOutputVertex()
Whether the GraphVertex is an output vertex
|
void |
setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
|
void |
setInput(int inputNumber,
org.nd4j.linalg.api.ndarray.INDArray input,
LayerWorkspaceMgr workspaceMgr)
Set the input activations.
|
void |
setLayerAsFrozen()
Only applies to layer vertices.
|
String |
toString() |
canDoForward, clear, clearVertex, getEpsilon, getInputVertices, getNumInputArrays, getNumOutputConnections, getOutputVertices, getVertexIndex, getVertexName, isInputVertex, setEpsilon, setInputVertices, setOutputVerticesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputs, setInputs, setOutputVertexpublic LayerVertex(ComputationGraph graph, String name, int vertexIndex, Layer layer, InputPreProcessor layerPreProcessor, boolean outputVertex)
public LayerVertex(ComputationGraph graph, String name, int vertexIndex, VertexIndices[] inputVertices, VertexIndices[] outputVertices, Layer layer, InputPreProcessor layerPreProcessor, boolean outputVertex)
public boolean hasLayer()
GraphVertexLayer object or notpublic void setLayerAsFrozen()
GraphVertexsetLayerAsFrozen in interface GraphVertexsetLayerAsFrozen in class BaseGraphVertexpublic boolean isOutputVertex()
GraphVertexpublic Layer getLayer()
GraphVertexGraphVertex.hasLayer() == falsepublic org.nd4j.linalg.api.ndarray.INDArray doForward(boolean training,
LayerWorkspaceMgr workspaceMgr)
GraphVertextraining - if true: forward pass at training time. If false: forward pass at test timeprotected void applyPreprocessorAndSetInput(LayerWorkspaceMgr workspaceMgr)
public org.nd4j.linalg.primitives.Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray[]> doBackward(boolean tbptt, LayerWorkspaceMgr workspaceMgr)
GraphVertextbptt - If true: do backprop using truncated BPTTpublic void setInput(int inputNumber,
org.nd4j.linalg.api.ndarray.INDArray input,
LayerWorkspaceMgr workspaceMgr)
GraphVertexsetInput in interface GraphVertexsetInput in class BaseGraphVertexinputNumber - Must be in range 0 to GraphVertex.getNumInputArrays()-1input - The input arraypublic void setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
GraphVertexpublic org.nd4j.linalg.primitives.Pair<org.nd4j.linalg.api.ndarray.INDArray,MaskState> feedForwardMaskArrays(org.nd4j.linalg.api.ndarray.INDArray[] maskArrays, MaskState currentMaskState, int minibatchSize)
public String toString()
toString in class BaseGraphVertexpublic boolean canDoBackward()
GraphVertexcanDoBackward in interface GraphVertexcanDoBackward in class BaseGraphVertexpublic double computeScore(double l1,
double l2,
boolean training,
LayerWorkspaceMgr workspaceMgr)
public org.nd4j.linalg.api.ndarray.INDArray computeScoreForExamples(double l1,
double l2,
LayerWorkspaceMgr workspaceMgr)
Copyright © 2018. All rights reserved.