MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.param.ReshapeParameter Class Reference

Specifies the parameters for the ReshapeLayer. More...

Inheritance diagram for MyCaffe.param.ReshapeParameter:
MyCaffe.param.LayerParameterBase MyCaffe.basecode.BaseParameter MyCaffe.basecode.IBinaryPersist

Public Member Functions

 ReshapeParameter ()
 Constructor for the parameter. More...
 
override object Load (System.IO.BinaryReader br, bool bNewInstance=true)
 Load the parameter from a binary reader. More...
 
override void Copy (LayerParameterBase src)
 Copy on parameter to another. More...
 
override LayerParameterBase Clone ()
 Creates a new copy of this instance of the parameter. More...
 
override RawProto ToProto (string strName)
 Convert the parameter into a RawProto. More...
 
- Public Member Functions inherited from MyCaffe.param.LayerParameterBase
 LayerParameterBase ()
 Constructor for the parameter. More...
 
virtual string PrepareRunModelInputs ()
 This method gives derivative classes a chance specify model inputs required by the run model. More...
 
virtual void PrepareRunModel (LayerParameter p)
 This method gives derivative classes a chance to prepare the layer for a run-model. More...
 
void Save (BinaryWriter bw)
 Save this parameter to a binary writer. More...
 
abstract object Load (BinaryReader br, bool bNewInstance=true)
 Load the parameter from a binary reader. More...
 
- Public Member Functions inherited from MyCaffe.basecode.BaseParameter
 BaseParameter ()
 Constructor for the parameter. More...
 
virtual bool Compare (BaseParameter p)
 Compare this parameter to another parameter. More...
 

Static Public Member Functions

static ReshapeParameter FromProto (RawProto rp)
 Parses the parameter from a RawProto. More...
 
static List< int > CalculateCopyAxes (LayerParameter p, out int nInferredAxis, out int nConstantCount, Log log=null)
 Calculate the Copy Axes, inferred axis and constant count. More...
 
static List< int > Reshape (LayerParameter p, List< int > rgShape, List< int > rgCopyAxes, int nInferredAxis, int nConstantCount, Log log=null)
 Calculates the new shape. More...
 
- Static Public Member Functions inherited from MyCaffe.basecode.BaseParameter
static double ParseDouble (string strVal)
 Parse double values using the US culture if the decimal separator = '.', then using the native culture, and if then lastly trying the US culture to handle prototypes containing '.' as the separator, yet parsed in a culture that does not use '.' as a decimal. More...
 
static bool TryParse (string strVal, out double df)
 Parse double values using the US culture if the decimal separator = '.', then using the native culture, and if then lastly trying the US culture to handle prototypes containing '.' as the separator, yet parsed in a culture that does not use '.' as a decimal. More...
 
static float ParseFloat (string strVal)
 Parse float values using the US culture if the decimal separator = '.', then using the native culture, and if then lastly trying the US culture to handle prototypes containing '.' as the separator, yet parsed in a culture that does not use '.' as a decimal. More...
 
static bool TryParse (string strVal, out float f)
 Parse doufloatble values using the US culture if the decimal separator = '.', then using the native culture, and if then lastly trying the US culture to handle prototypes containing '.' as the separator, yet parsed in a culture that does not use '.' as a decimal. More...
 

Properties

BlobShape shape [getset]
 Specifies the output dimensions. More...
 
int axis [getset]
 Specifies the axis portion of the bottom blob's shape that is replaced by (included in) the reshape. By default (axis == 0 and num_axes == -1), the entire bottom blob shape is included in the reshape, and hence the shape field must specify the entire output shape. More...
 
int num_axes [getset]
 num_axes specifies the extent of the reshape. More...
 

Additional Inherited Members

- Public Types inherited from MyCaffe.param.LayerParameterBase
enum  LABEL_TYPE { NONE , SINGLE , MULTIPLE , ONLY_ONE }
 Defines the label type. More...
 

Detailed Description

Specifies the parameters for the ReshapeLayer.

Definition at line 15 of file ReshapeParameter.cs.

Constructor & Destructor Documentation

◆ ReshapeParameter()

MyCaffe.param.ReshapeParameter.ReshapeParameter ( )

Constructor for the parameter.

Definition at line 22 of file ReshapeParameter.cs.

Member Function Documentation

◆ CalculateCopyAxes()

static List< int > MyCaffe.param.ReshapeParameter.CalculateCopyAxes ( LayerParameter  p,
out int  nInferredAxis,
out int  nConstantCount,
Log  log = null 
)
static

Calculate the Copy Axes, inferred axis and constant count.

Parameters
pSpecifies the layer parameters.
nInferredAxisReturns the inferred axis.
nConstantCountReturns the constant count.
logOptionally, specifies the output log (default = null, which ignores this parameter).
Returns
The copy axes are returned.

Definition at line 210 of file ReshapeParameter.cs.

◆ Clone()

override LayerParameterBase MyCaffe.param.ReshapeParameter.Clone ( )
virtual

Creates a new copy of this instance of the parameter.

Returns
A new instance of this parameter is returned.

Implements MyCaffe.param.LayerParameterBase.

Definition at line 140 of file ReshapeParameter.cs.

◆ Copy()

override void MyCaffe.param.ReshapeParameter.Copy ( LayerParameterBase  src)
virtual

Copy on parameter to another.

Parameters
srcSpecifies the parameter to copy.

Implements MyCaffe.param.LayerParameterBase.

Definition at line 128 of file ReshapeParameter.cs.

◆ FromProto()

static ReshapeParameter MyCaffe.param.ReshapeParameter.FromProto ( RawProto  rp)
static

Parses the parameter from a RawProto.

Parameters
rpSpecifies the RawProto to parse.
Returns
A new instance of the parameter is returned.

Definition at line 172 of file ReshapeParameter.cs.

◆ Load()

override object MyCaffe.param.ReshapeParameter.Load ( System.IO.BinaryReader  br,
bool  bNewInstance = true 
)

Load the parameter from a binary reader.

Parameters
brSpecifies the binary reader.
bNewInstanceWhen true a new instance is created (the default), otherwise the existing instance is loaded from the binary reader.
Returns
Returns an instance of the parameter.

Definition at line 116 of file ReshapeParameter.cs.

◆ Reshape()

static List< int > MyCaffe.param.ReshapeParameter.Reshape ( LayerParameter  p,
List< int >  rgShape,
List< int >  rgCopyAxes,
int  nInferredAxis,
int  nConstantCount,
Log  log = null 
)
static

Calculates the new shape.

Parameters
pSpecifies the layer parameters.
rgShapeSpecifies the Bottom[0] shape.
rgCopyAxesSpecifies the copy axes.
nInferredAxisSpecifies the inferred axis (if any).
nConstantCountSpecifies the constant count.
logSpecifies the output log.
Returns
The new top shape is returned.

Definition at line 254 of file ReshapeParameter.cs.

◆ ToProto()

override RawProto MyCaffe.param.ReshapeParameter.ToProto ( string  strName)
virtual

Convert the parameter into a RawProto.

Parameters
strNameSpecifies the name to associate with the RawProto.
Returns
The new RawProto is returned.

Implements MyCaffe.basecode.BaseParameter.

Definition at line 152 of file ReshapeParameter.cs.

Property Documentation

◆ axis

int MyCaffe.param.ReshapeParameter.axis
getset

Specifies the axis portion of the bottom blob's shape that is replaced by (included in) the reshape. By default (axis == 0 and num_axes == -1), the entire bottom blob shape is included in the reshape, and hence the shape field must specify the entire output shape.

axis may be non-zero to retain some portion of the beginning of the input shape (and may be negative to index from the end; e.g., -1 to begin the reshape after the last axis, including nothing in the reshape, -2 to icnlude only the last axis, etc.).

For example, suppose, 'input' is the 2D blob with shape 2 x 8. Then the following RehsapeLayer specifications are all equivalent, producing a blob 'output' with shape 2 x 2 x 4:

reshape_param { shape { dim: 2 dim: 2 dim: 4 } } resahpe_param { shape { dim: 2 dim: 4 } axis: 1 } reshape_param { shape [ dim: 2 dim: 4 } axis: -3 }

Definition at line 80 of file ReshapeParameter.cs.

◆ num_axes

int MyCaffe.param.ReshapeParameter.num_axes
getset

num_axes specifies the extent of the reshape.

If num_axes >= 0 (and axis >= 0), the reshape will be performed only on input axes in the range [axis, axis+num_axes]. num_axes may also be -1, the default, to include all remaining axes (starting from axis).

For example, suppose, 'input' is the 2D blob with shape 2 x 8. Then the following RehsapeLayer specifications are all equivalent, producing a blob 'output' with shape 1 x 2 x 8:

reshape_param { shape { dim: 1 dim: 2 dim: 8 } } resahpe_param { shape { dim: 1 dim: 2 } num_axes: 1 } reshape_param { shape [ dim: 1 } num_axes: 0 }

On the other hand, these would produce output blob shape 2 x 1 x 8:

reshape_param { shape { dim: 2 dim: 1 dim: 8 } } resahpe_param { shape { dim: 1 } axis: 1 num_axes: 0 }

Definition at line 109 of file ReshapeParameter.cs.

◆ shape

BlobShape MyCaffe.param.ReshapeParameter.shape
getset

Specifies the output dimensions.

If some of the dimensions are set to 0, the corresponding dimension from the bottom layer is used (unchanged). Exactly one dimension may be set to -1, in which case its value is inferred from the count of the bottom blob and the remaining dimensions.

For example, suppose we want to reshape a 2D blob 'input' with shape 2 x 8:

layer { type: 'Reshape' bottom: 'input' top: 'output' reshape_param { ... } }

If 'input' is 2D with shape 2 x 8, then the following reshape_param specifications are all equivalent, producing a 3D blob 'output' with shape 2 x 2 x 4:

reshape_param { shape { dim: 2 dim: 2 dim: 4 } } reshape_param { shape { dim: 0 dim: 2 dim: 4 } } reshape_param { shape { dim: 0 dim: 2 dim: -1 } } reshape_param { shape { dim: 0 dim:-1 dim: 4 } }

Definition at line 52 of file ReshapeParameter.cs.


The documentation for this class was generated from the following file: