Package org.deeplearning4j.nn.conf.graph
Class ReshapeVertex
- java.lang.Object
-
- org.deeplearning4j.nn.conf.graph.GraphVertex
-
- org.deeplearning4j.nn.conf.graph.ReshapeVertex
-
- All Implemented Interfaces:
Serializable,Cloneable
public class ReshapeVertex extends GraphVertex
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static charDEFAULT_RESHAPE_ORDERprotected int[]maskShapeprotected int[]newShapeprotected charreshapeOrder
-
Constructor Summary
Constructors Constructor Description ReshapeVertex(char reshapeOrder, int[] newShape, int[] maskShape)ReshapeVertex(int... newShape)Reshape with the default reshape order of 'c'
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReshapeVertexclone()booleanequals(Object o)MemoryReportgetMemoryReport(InputType... inputTypes)This is a report of the estimated memory consumption for the given vertexInputTypegetOutputType(int layerIndex, InputType... vertexInputs)Determine the type of output for this GraphVertex, given the specified inputs.inthashCode()GraphVertexinstantiate(ComputationGraph graph, String name, int idx, INDArray paramsView, boolean initializeParams, DataType networkDatatype)Create aGraphVertexinstance, for the given computation graph, given the configuration instance.intmaxVertexInputs()intminVertexInputs()longnumParams(boolean backprop)-
Methods inherited from class org.deeplearning4j.nn.conf.graph.GraphVertex
setDataType
-
-
-
-
Field Detail
-
DEFAULT_RESHAPE_ORDER
public static final char DEFAULT_RESHAPE_ORDER
- See Also:
- Constant Field Values
-
reshapeOrder
protected char reshapeOrder
-
newShape
protected int[] newShape
-
maskShape
protected int[] maskShape
-
-
Constructor Detail
-
ReshapeVertex
public ReshapeVertex(int... newShape)
Reshape with the default reshape order of 'c'- Parameters:
newShape- New shape for activations
-
ReshapeVertex
public ReshapeVertex(char reshapeOrder, int[] newShape, int[] maskShape)- Parameters:
reshapeOrder- Order (must be 'c' or 'f') for the activationsnewShape- New shapemaskShape- Mask shape
-
-
Method Detail
-
clone
public ReshapeVertex clone()
- Specified by:
clonein classGraphVertex
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classGraphVertex
-
hashCode
public int hashCode()
- Specified by:
hashCodein classGraphVertex
-
numParams
public long numParams(boolean backprop)
- Specified by:
numParamsin classGraphVertex
-
minVertexInputs
public int minVertexInputs()
- Specified by:
minVertexInputsin classGraphVertex- Returns:
- The Smallest valid number of inputs to this vertex
-
maxVertexInputs
public int maxVertexInputs()
- Specified by:
maxVertexInputsin classGraphVertex- Returns:
- The largest valid number of inputs to this vertex
-
instantiate
public GraphVertex instantiate(ComputationGraph graph, String name, int idx, INDArray paramsView, boolean initializeParams, DataType networkDatatype)
Description copied from class:GraphVertexCreate aGraphVertexinstance, for the given computation graph, given the configuration instance.- Specified by:
instantiatein classGraphVertex- 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 array- Returns:
- The implementation GraphVertex object (i.e., implementation, no the configuration)
-
getOutputType
public InputType getOutputType(int layerIndex, InputType... vertexInputs) throws InvalidInputTypeException
Description copied from class:GraphVertexDetermine 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- Specified by:
getOutputTypein classGraphVertex- 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 MemoryReport getMemoryReport(InputType... inputTypes)
Description copied from class:GraphVertexThis is a report of the estimated memory consumption for the given vertex- Specified by:
getMemoryReportin classGraphVertex- Parameters:
inputTypes- Input types to the vertex. Memory consumption is often a function of the input type- Returns:
- Memory report for the vertex
-
-