MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
Specifies the parameters for the ReshapeLayer. More...
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... | |
Specifies the parameters for the ReshapeLayer.
Definition at line 15 of file ReshapeParameter.cs.
MyCaffe.param.ReshapeParameter.ReshapeParameter | ( | ) |
Constructor for the parameter.
Definition at line 22 of file ReshapeParameter.cs.
|
static |
Calculate the Copy Axes, inferred axis and constant count.
p | Specifies the layer parameters. |
nInferredAxis | Returns the inferred axis. |
nConstantCount | Returns the constant count. |
log | Optionally, specifies the output log (default = null, which ignores this parameter). |
Definition at line 210 of file ReshapeParameter.cs.
|
virtual |
Creates a new copy of this instance of the parameter.
Implements MyCaffe.param.LayerParameterBase.
Definition at line 140 of file ReshapeParameter.cs.
|
virtual |
Copy on parameter to another.
src | Specifies the parameter to copy. |
Implements MyCaffe.param.LayerParameterBase.
Definition at line 128 of file ReshapeParameter.cs.
|
static |
Parses the parameter from a RawProto.
rp | Specifies the RawProto to parse. |
Definition at line 172 of file ReshapeParameter.cs.
override object MyCaffe.param.ReshapeParameter.Load | ( | System.IO.BinaryReader | br, |
bool | bNewInstance = true |
||
) |
Load the parameter from a binary reader.
br | Specifies the binary reader. |
bNewInstance | When true a new instance is created (the default), otherwise the existing instance is loaded from the binary reader. |
Definition at line 116 of file ReshapeParameter.cs.
|
static |
Calculates the new shape.
p | Specifies the layer parameters. |
rgShape | Specifies the Bottom[0] shape. |
rgCopyAxes | Specifies the copy axes. |
nInferredAxis | Specifies the inferred axis (if any). |
nConstantCount | Specifies the constant count. |
log | Specifies the output log. |
Definition at line 254 of file ReshapeParameter.cs.
|
virtual |
Convert the parameter into a RawProto.
strName | Specifies the name to associate with the RawProto. |
Implements MyCaffe.basecode.BaseParameter.
Definition at line 152 of file ReshapeParameter.cs.
|
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.
|
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.
|
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.