Package org.deeplearning4j.nn.conf.graph
Class GraphVertex
- java.lang.Object
-
- org.deeplearning4j.nn.conf.graph.GraphVertex
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
DuplicateToTimeSeriesVertex,ElementWiseVertex,FrozenVertex,L2NormalizeVertex,L2Vertex,LastTimeStepVertex,LayerVertex,MergeVertex,PoolHelperVertex,PreprocessorVertex,ReshapeVertex,ReverseTimeSeriesVertex,SameDiffVertex,ScaleVertex,ShiftVertex,StackVertex,SubsetVertex,UnstackVertex
public abstract class GraphVertex extends Object implements Cloneable, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GraphVertex()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract GraphVertexclone()abstract booleanequals(Object o)abstract MemoryReportgetMemoryReport(InputType... inputTypes)This is a report of the estimated memory consumption for the given vertexabstract InputTypegetOutputType(int layerIndex, InputType... vertexInputs)Determine the type of output for this GraphVertex, given the specified inputs.abstract inthashCode()abstract GraphVertexinstantiate(ComputationGraph graph, String name, int idx, INDArray paramsView, boolean initializeParams, DataType networkDatatype)Create aGraphVertexinstance, for the given computation graph, given the configuration instance.abstract intmaxVertexInputs()abstract intminVertexInputs()abstract longnumParams(boolean backprop)voidsetDataType(DataType dataType)
-
-
-
Method Detail
-
clone
public abstract GraphVertex clone()
-
numParams
public abstract long numParams(boolean backprop)
-
minVertexInputs
public abstract int minVertexInputs()
- Returns:
- The Smallest valid number of inputs to this vertex
-
maxVertexInputs
public abstract int maxVertexInputs()
- Returns:
- The largest valid number of inputs to this vertex
-
instantiate
public abstract GraphVertex instantiate(ComputationGraph graph, String name, int idx, INDArray paramsView, boolean initializeParams, DataType networkDatatype)
Create aGraphVertexinstance, for the given computation graph, given the configuration instance.- Parameters:
graph- The computation graph that this GraphVertex is to be part ofname- The name of the GraphVertex objectidx- The index of the GraphVertexparamsView- A view of the full parameters arrayinitializeParams- If true: initialize the parameters. If false: make no change to the values in the paramsView arraynetworkDatatype-- Returns:
- The implementation GraphVertex object (i.e., implementation, no the configuration)
-
getOutputType
public abstract InputType getOutputType(int layerIndex, InputType... vertexInputs) throws InvalidInputTypeException
Determine the type of output for this GraphVertex, given the specified inputs. Given that a GraphVertex may do arbitrary processing or modifications of the inputs, the output types can be quite different to the input type(s).
This is generally used to determine when to add preprocessors, as well as the input sizes etc for layers- Parameters:
layerIndex- The index of the layer (if appropriate/necessary).vertexInputs- The inputs to this vertex- Returns:
- The type of output for this vertex
- Throws:
InvalidInputTypeException- If the input type is invalid for this type of GraphVertex
-
getMemoryReport
public abstract MemoryReport getMemoryReport(InputType... inputTypes)
This is a report of the estimated memory consumption for the given vertex- Parameters:
inputTypes- Input types to the vertex. Memory consumption is often a function of the input type- Returns:
- Memory report for the vertex
-
setDataType
public void setDataType(DataType dataType)
-
-