public class LayerVertex extends BaseGraphVertex
InputPreProcessor) in itdataType, epsilon, graph, inputs, inputVertices, outputVertex, outputVertices, vertexIndex, vertexName| Constructor and Description |
|---|
LayerVertex(ComputationGraph graph,
String name,
int vertexIndex,
Layer layer,
InputPreProcessor layerPreProcessor,
boolean outputVertex,
DataType dataType)
Create a network input vertex:
|
LayerVertex(ComputationGraph graph,
String name,
int vertexIndex,
VertexIndices[] inputVertices,
VertexIndices[] outputVertices,
Layer layer,
InputPreProcessor layerPreProcessor,
boolean outputVertex,
DataType dataType) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyPreprocessorAndSetInput(LayerWorkspaceMgr workspaceMgr) |
boolean |
canDoBackward()
Whether the GraphVertex can do backward pass.
|
double |
computeScore(double r,
boolean training,
LayerWorkspaceMgr workspaceMgr) |
INDArray |
computeScoreForExamples(double r,
LayerWorkspaceMgr workspaceMgr) |
Pair<Gradient,INDArray[]> |
doBackward(boolean tbptt,
LayerWorkspaceMgr workspaceMgr)
Do backward pass
|
INDArray |
doForward(boolean training,
LayerWorkspaceMgr workspaceMgr)
Do forward pass using the stored inputs
|
Pair<INDArray,MaskState> |
feedForwardMaskArrays(INDArray[] maskArrays,
MaskState currentMaskState,
int minibatchSize) |
TrainingConfig |
getConfig() |
INDArray |
getGradientsViewArray() |
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
|
INDArray |
params() |
Map<String,INDArray> |
paramTable(boolean backpropOnly)
Get the parameter table for the vertex
|
void |
setBackpropGradientsViewArray(INDArray backpropGradientsViewArray)
|
void |
setInput(int inputNumber,
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, numParams, setEpsilon, setInputVertices, setOutputVertices, updaterDivideByMinibatchclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputs, setInputs, setOutputVertexpublic LayerVertex(ComputationGraph graph, String name, int vertexIndex, Layer layer, InputPreProcessor layerPreProcessor, boolean outputVertex, DataType dataType)
public LayerVertex(ComputationGraph graph, String name, int vertexIndex, VertexIndices[] inputVertices, VertexIndices[] outputVertices, Layer layer, InputPreProcessor layerPreProcessor, boolean outputVertex, DataType dataType)
public boolean hasLayer()
GraphVertexLayer object or notpublic void setLayerAsFrozen()
GraphVertexsetLayerAsFrozen in interface GraphVertexsetLayerAsFrozen in class BaseGraphVertexpublic Map<String,INDArray> paramTable(boolean backpropOnly)
GraphVertexparamTable in interface TrainableparamTable in interface GraphVertexparamTable in class BaseGraphVertexbackpropOnly - If true: exclude unsupervised training parameterspublic boolean isOutputVertex()
GraphVertexpublic Layer getLayer()
GraphVertexGraphVertex.hasLayer() == falsepublic INDArray doForward(boolean training, LayerWorkspaceMgr workspaceMgr)
GraphVertextraining - if true: forward pass at training time. If false: forward pass at test timepublic void applyPreprocessorAndSetInput(LayerWorkspaceMgr workspaceMgr)
public Pair<Gradient,INDArray[]> doBackward(boolean tbptt, LayerWorkspaceMgr workspaceMgr)
GraphVertextbptt - If true: do backprop using truncated BPTTpublic void setInput(int inputNumber,
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(INDArray backpropGradientsViewArray)
GraphVertexpublic Pair<INDArray,MaskState> feedForwardMaskArrays(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 r,
boolean training,
LayerWorkspaceMgr workspaceMgr)
public INDArray computeScoreForExamples(double r, LayerWorkspaceMgr workspaceMgr)
public TrainingConfig getConfig()
getConfig in interface TrainablegetConfig in class BaseGraphVertexpublic INDArray params()
params in interface Trainableparams in class BaseGraphVertexpublic INDArray getGradientsViewArray()
getGradientsViewArray in interface TrainablegetGradientsViewArray in class BaseGraphVertexCopyright © 2020. All rights reserved.