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

Stores parameters used to apply transformation to the data layer's data. More...

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

Public Types

enum  SCALE_OPERATOR { NONE , MUL , POW }
 Defines the type of scale operator to use (if any). More...
 
enum  COLOR_ORDER { RGB = 0 , BGR = 1 }
 Defines the color ordering used to tranform the input data. More...
 
- Public Types inherited from MyCaffe.param.LayerParameterBase
enum  LABEL_TYPE { NONE , SINGLE , MULTIPLE , ONLY_ONE }
 Defines the label type. More...
 

Public Member Functions

 TransformationParameter ()
 The constructor. 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 TransformationParameter FromProto (RawProto rp)
 Parses the parameter from a RawProto. 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

double forced_positive_range_max [getset]
 Specifies whether or not to fit the data into a forced range of [0, forced_positive_range_max].
More...
 
double scale [getset]
 For data pre-processing, we can do simple scaling and subtracting the data mean, if provided. Note that the mean subtraction is always carried out before scaling. More...
 
SCALE_OPERATORscale_operator [getset]
 Get/set the scale operator used to apply the scale value to the data-mean or data result. More...
 
bool mirror [getset]
 Specify if we want to randomly mirror the data. More...
 
uint crop_size [getset]
 Specify if we would like to randomly crop an image. More...
 
bool use_imagedb_mean [getset]
 Specifies whether to subtract the mean image from the image database, subtract the mean values, or neither and do no mean subtraction. More...
 
List< double > mean_value [getset]
 If specified can be repeated once (would subtract it from all the channels or can be repeated the same number of times as channels (would subtract them from the corresponding channel). More...
 
bool force_color [getset]
 Force the decoded image to have 3 color channels. More...
 
bool force_gray [getset]
 Force the decoded image to have 1 color channel. More...
 
int? random_seed [getset]
 Only used during testing. More...
 
string mean_file [getset]
 Specifies the path to file containing the image mean in the proto buffer format of a BlobProto. More...
 
COLOR_ORDER color_order [getset]
 Specifies the color ordering to use. Native Caffe models often uses COLOR_ORDER.BGR, whereas MyCaffe datasets often uses the COLOR_ORDER.RGB ordering. More...
 
ResizeParameter resize_param [getset]
 Optionally, specifies the resize policy, otherwise this is null. More...
 
NoiseParameter noise_param [getset]
 Optionally, specifies the noise policy, otherwise this is null. More...
 
DistortionParameter distortion_param [getset]
 Optionally, specifies the distortion policy, otherwise this is null. More...
 
ExpansionParameter expansion_param [getset]
 Optionally, specifies the expansion policy, otherwise this is null. More...
 
EmitConstraint emit_constraint [getset]
 Optionally, specifies the emit constraint on emitting annotation after transformation, otherwise this is null. More...
 
MaskParameter mask_param [getset]
 Optionally, specifies the image mask which defines the boundary area that is set to black on the image thus masking that area out. More...
 
DataLabelMappingParameter label_mapping [getset]
 Optionally, specifies the label mapping which defines how to map lables when calling the DataTransformer.TransformLabel method. More...
 

Detailed Description

Stores parameters used to apply transformation to the data layer's data.

Definition at line 18 of file TransformationParameter.cs.

Member Enumeration Documentation

◆ COLOR_ORDER

Defines the color ordering used to tranform the input data.

Enumerator
RGB 

Orders the channels by 'R'ed, 'G'reen, then 'B'lue.

BGR 

Orders the channels by 'B'lue, 'G'reen, then 'R'ed. This ordering is typically used by Native C++ Caffe.

Definition at line 62 of file TransformationParameter.cs.

◆ SCALE_OPERATOR

Defines the type of scale operator to use (if any).

Enumerator
NONE 

Specifies to not scale the data.

MUL 

Specifies to use the multiplication operator where the scale is multiplied by the result of the data-mean.

POW 

Specifies to use the power operator where the data-mean is raised to the power of the scale value.

Definition at line 43 of file TransformationParameter.cs.

Constructor & Destructor Documentation

◆ TransformationParameter()

MyCaffe.param.TransformationParameter.TransformationParameter ( )

The constructor.

Definition at line 77 of file TransformationParameter.cs.

Member Function Documentation

◆ Clone()

override LayerParameterBase MyCaffe.param.TransformationParameter.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 352 of file TransformationParameter.cs.

◆ Copy()

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

Copy on parameter to another.

Parameters
srcSpecifies the parameter to copy.

Implements MyCaffe.param.LayerParameterBase.

Definition at line 321 of file TransformationParameter.cs.

◆ FromProto()

static TransformationParameter MyCaffe.param.TransformationParameter.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 428 of file TransformationParameter.cs.

◆ Load()

override object MyCaffe.param.TransformationParameter.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 309 of file TransformationParameter.cs.

◆ ToProto()

override RawProto MyCaffe.param.TransformationParameter.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 364 of file TransformationParameter.cs.

Property Documentation

◆ color_order

COLOR_ORDER MyCaffe.param.TransformationParameter.color_order
getset

Specifies the color ordering to use. Native Caffe models often uses COLOR_ORDER.BGR, whereas MyCaffe datasets often uses the COLOR_ORDER.RGB ordering.

Definition at line 210 of file TransformationParameter.cs.

◆ crop_size

uint MyCaffe.param.TransformationParameter.crop_size
getset

Specify if we would like to randomly crop an image.

Definition at line 127 of file TransformationParameter.cs.

◆ distortion_param

DistortionParameter MyCaffe.param.TransformationParameter.distortion_param
getset

Optionally, specifies the distortion policy, otherwise this is null.

Currently, this parameter is only used by the AnnotatedDataLayer.

Definition at line 249 of file TransformationParameter.cs.

◆ emit_constraint

EmitConstraint MyCaffe.param.TransformationParameter.emit_constraint
getset

Optionally, specifies the emit constraint on emitting annotation after transformation, otherwise this is null.

Currently, this parameter is only used by the AnnotatedDataLayer.

Definition at line 275 of file TransformationParameter.cs.

◆ expansion_param

ExpansionParameter MyCaffe.param.TransformationParameter.expansion_param
getset

Optionally, specifies the expansion policy, otherwise this is null.

Currently, this parameter is only used by the AnnotatedDataLayer.

Definition at line 262 of file TransformationParameter.cs.

◆ force_color

bool MyCaffe.param.TransformationParameter.force_color
getset

Force the decoded image to have 3 color channels.

Definition at line 165 of file TransformationParameter.cs.

◆ force_gray

bool MyCaffe.param.TransformationParameter.force_gray
getset

Force the decoded image to have 1 color channel.

Definition at line 175 of file TransformationParameter.cs.

◆ forced_positive_range_max

double MyCaffe.param.TransformationParameter.forced_positive_range_max
getset

Specifies whether or not to fit the data into a forced range of [0, forced_positive_range_max].

Definition at line 86 of file TransformationParameter.cs.

◆ label_mapping

DataLabelMappingParameter MyCaffe.param.TransformationParameter.label_mapping
getset

Optionally, specifies the label mapping which defines how to map lables when calling the DataTransformer.TransformLabel method.

Currently, this parameter is only used by the DataLayer.

Definition at line 302 of file TransformationParameter.cs.

◆ mask_param

MaskParameter MyCaffe.param.TransformationParameter.mask_param
getset

Optionally, specifies the image mask which defines the boundary area that is set to black on the image thus masking that area out.

The mask is applied last, after all other alterations are made.

Currently, this parameter is only used by the DataLayer.

Definition at line 290 of file TransformationParameter.cs.

◆ mean_file

string MyCaffe.param.TransformationParameter.mean_file
getset

Specifies the path to file containing the image mean in the proto buffer format of a BlobProto.

The mean file is used when specified and the 'use_imagedb_mean' = true. If the 'use_imagedb_mean' = true and the mean file is not set, the Caffe Image Database is queried for the calculated mean image.

Definition at line 199 of file TransformationParameter.cs.

◆ mean_value

List<double> MyCaffe.param.TransformationParameter.mean_value
getset

If specified can be repeated once (would subtract it from all the channels or can be repeated the same number of times as channels (would subtract them from the corresponding channel).

So for example if there are 3 channels, mean_value could have 3 values, one for each channel – or just one value which would be applied to all channels.

Definition at line 155 of file TransformationParameter.cs.

◆ mirror

bool MyCaffe.param.TransformationParameter.mirror
getset

Specify if we want to randomly mirror the data.

Definition at line 117 of file TransformationParameter.cs.

◆ noise_param

NoiseParameter MyCaffe.param.TransformationParameter.noise_param
getset

Optionally, specifies the noise policy, otherwise this is null.

Currently, this parameter is only used by the DataLayer.

Definition at line 236 of file TransformationParameter.cs.

◆ random_seed

int? MyCaffe.param.TransformationParameter.random_seed
getset

Only used during testing.

Definition at line 185 of file TransformationParameter.cs.

◆ resize_param

ResizeParameter MyCaffe.param.TransformationParameter.resize_param
getset

Optionally, specifies the resize policy, otherwise this is null.

Currently, this parameter is only used by the AnnotatedDataLayer.

Definition at line 223 of file TransformationParameter.cs.

◆ scale

double MyCaffe.param.TransformationParameter.scale
getset

For data pre-processing, we can do simple scaling and subtracting the data mean, if provided. Note that the mean subtraction is always carried out before scaling.

Definition at line 98 of file TransformationParameter.cs.

◆ scale_operator

SCALE_OPERATOR? MyCaffe.param.TransformationParameter.scale_operator
getset

Get/set the scale operator used to apply the scale value to the data-mean or data result.

Definition at line 107 of file TransformationParameter.cs.

◆ use_imagedb_mean

bool MyCaffe.param.TransformationParameter.use_imagedb_mean
getset

Specifies whether to subtract the mean image from the image database, subtract the mean values, or neither and do no mean subtraction.

Definition at line 138 of file TransformationParameter.cs.


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