public class LayerVertex extends BaseGraphVertex
InputPreProcessor
) in itepsilons, graph, inputs, inputVertices, 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 |
---|---|
boolean |
canDoBackward()
Whether the GraphVertex can do backward pass.
|
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
|
Layer |
getLayer()
Get the Layer (if any).
|
boolean |
hasLayer()
whether the GraphVertex contains a
Layer object or not |
boolean |
isOutputVertex()
Whether the GraphVertexis an output vertex
|
void |
setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
|
void |
setInput(int inputNumber,
org.nd4j.linalg.api.ndarray.INDArray input)
Set the input activations.
|
String |
toString() |
canDoForward, clear, getErrors, getInputVertices, getNumInputArrays, getNumOutputConnections, getOutputVertices, getVertexIndex, getVertexName, isInputVertex, setError, setErrors, setInputVertices, setOutputVertices
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInputs, setInputs
public 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()
GraphVertex
Layer
object or notpublic boolean isOutputVertex()
GraphVertex
public Layer getLayer()
GraphVertex
GraphVertex.hasLayer()
== falsepublic org.nd4j.linalg.api.ndarray.INDArray doForward(boolean training)
GraphVertex
training
- if true: forward pass at training time. If false: forward pass at test timepublic Pair<Gradient,org.nd4j.linalg.api.ndarray.INDArray[]> doBackward(boolean tbptt)
GraphVertex
tbptt
- If true: do backprop using truncated BPTTpublic void setInput(int inputNumber, org.nd4j.linalg.api.ndarray.INDArray input)
GraphVertex
setInput
in interface GraphVertex
setInput
in class BaseGraphVertex
inputNumber
- Must be in range 0 to GraphVertex.getNumInputArrays()
-1input
- The input arraypublic void setBackpropGradientsViewArray(org.nd4j.linalg.api.ndarray.INDArray backpropGradientsViewArray)
GraphVertex
public String toString()
toString
in class BaseGraphVertex
public boolean canDoBackward()
GraphVertex
canDoBackward
in interface GraphVertex
canDoBackward
in class BaseGraphVertex
Copyright © 2016. All Rights Reserved.