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

Specifies the parameter for the data layer. More...

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

Public Types

enum  DB { NONE = 0 , IMAGEDB = 1 }
 Defines the database type to use. More...
 
- Public Types inherited from MyCaffe.param.LayerParameterBase
enum  LABEL_TYPE { NONE , SINGLE , MULTIPLE , ONLY_ONE }
 Defines the label type. More...
 

Public Member Functions

 DataParameter ()
 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 DataParameter FromProto (RawProto rp, DataParameter p=null)
 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

string source [getset]
 When used with the DATA parameter, specifies the data 'source' within the database. Some sources are used for training whereas others are used for testing. When used with the IMAGE_DATA parameter, the 'source' specifies the data 'source' file containing the list of image file names. Each dataset has both a training and testing data source. More...
 
virtual uint batch_size [getset]
 Specifies the batch size. More...
 
DB backend [getset]
 Specifies the backend database. More...
 
uint prefetch [getset]
 Prefetch queue (Number of batches to prefetch to host memory, increase if data access bandwidth varies). More...
 
bool? enable_random_selection [getset]
 (optional, default = null) Specifies whether or not to randomly query images from the data source. When enabled, images are queried in sequence which can often have poorer training results. More...
 
bool? enable_pair_selection [getset]
 (optional, default = null) Specifies whether or not to select images in a pair sequence. When enabled, the first image queried is queried using the 'random' selection property, and then the second image queried is the image just after the first image queried (even if queried randomly). More...
 
bool display_timing [getset]
 (optional, default = false) Specifies whether or not to display the timing of each image read. More...
 
LABEL_TYPE label_type [getset]
 (optional, default = SINGLE) Specifies the label type: SINGLE - the default which uses the 'Label' field, or MULTIPLE - which uses the 'DataCriteria' field.
More...
 
bool primary_data [getset]
 (optional, default = true) Specifies whether or not the data is the primary datset as opposed to a secondary, target dataset. More...
 
bool synchronize_target [getset]
 (optional, default = false) Specifies whether or not this is a to be synchronized with another data layer as the target. More...
 
string synchronize_with [getset]
 (optional, default = null) Specifies a secondary (target) dataset to syncrhonize with. More...
 
int images_per_blob [getset]
 (optional, default = 1) Specifies the number of images to load into each blob channel. For example when set to 2 two 3 channel images are loaded and stacked on the channel dimension, thus loading a 6 channel blob (2 images x 3 channels each). More...
 
bool output_all_labels [getset]
 (optional, default = false) When using images_per_blob > 1, 'output_all_labels' specifies to output all labels for the stacked images instead of just the comparison. More...
 
bool balance_matches [getset]
 (optional, default = true) When using images_per_blob > 1, 'balance_matches' specifies to query images by alternating similar matches followed by dissimilar matches in the next query. More...
 
bool output_image_information [getset]
 (optional, default = false) When true image information such as index and label are output. IMPORTANT: enabling this setting can dramatically slow down training and is only used for debugging. More...
 
int forced_primary_label [getset]
 (optional, default = -1) When >= 0, this label is used as the primary image label when 'images_per_blob' > 1. More...
 
bool enable_noise_for_nonmatch [getset]
 (optional, default = false) When true an image consisting of noise initialized with noise filler. More...
 
DataNoiseParameter data_noise_param [getset]
 Specifies the DataNoiseParameter used when 'enable_noise_for_nonmatch' = True. More...
 
bool enable_debug_output [getset]
 (optional, default = false) When true the data sent out through the top are saved as images into the debug directory specified by the data_debug_param. More...
 
DataDebugParameter data_debug_param [getset]
 Specifies the DataDebugParameter used when 'enable_debug_output' = True. More...
 
int one_hot_label_size [getset]
 When greater than 0 (default = 0), labels are one-hot encoded to a vector of the one-hot label size (e.g., when size = 4: 3 -> 0 1 1 0; 4 -> 1 0 0 0) More...
 

Events

EventHandler< VerifyBatchSizeArgsOnVerifyBatchSize
 This event is, optionally, called to verify the batch size of the DataParameter. More...
 

Detailed Description

Specifies the parameter for the data layer.

Note: given the new use of the Transformation Parameter, the depreciated elements of the DataParameter have been removed.

Definition at line 19 of file DataParameter.cs.

Member Enumeration Documentation

◆ DB

Defines the database type to use.

Enumerator
NONE 

Specifies that no backend database is used as is the case with the ImageDataLayer.

IMAGEDB 

Specifies to use the MyCaffeImageDatabase. Currently this is the only option.

Definition at line 24 of file DataParameter.cs.

Constructor & Destructor Documentation

◆ DataParameter()

MyCaffe.param.DataParameter.DataParameter ( )

Constructor for the parameter.

Definition at line 64 of file DataParameter.cs.

Member Function Documentation

◆ Clone()

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

◆ Copy()

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

Copy on parameter to another.

Parameters
srcSpecifies the parameter to copy.

Implements MyCaffe.param.LayerParameterBase.

Definition at line 316 of file DataParameter.cs.

◆ FromProto()

static DataParameter MyCaffe.param.DataParameter.FromProto ( RawProto  rp,
DataParameter  p = null 
)
static

Parses the parameter from a RawProto.

Parameters
rpSpecifies the RawProto to parse.
pOptionally, specifies an instance to load. If null, a new instance is created and loaded.
Returns
A new instance of the parameter is returned.

Definition at line 423 of file DataParameter.cs.

◆ Load()

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

◆ ToProto()

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

Property Documentation

◆ backend

DB MyCaffe.param.DataParameter.backend
getset

Specifies the backend database.

NOTE: Currently only the IMAGEDB is supported, which is a separate component used to load and manage all images within a given dataset.

Definition at line 107 of file DataParameter.cs.

◆ balance_matches

bool MyCaffe.param.DataParameter.balance_matches
getset

(optional, default = true) When using images_per_blob > 1, 'balance_matches' specifies to query images by alternating similar matches followed by dissimilar matches in the next query.

Definition at line 227 of file DataParameter.cs.

◆ batch_size

virtual uint MyCaffe.param.DataParameter.batch_size
getset

Specifies the batch size.

Definition at line 82 of file DataParameter.cs.

◆ data_debug_param

DataDebugParameter MyCaffe.param.DataParameter.data_debug_param
getset

Specifies the DataDebugParameter used when 'enable_debug_output' = True.

Definition at line 287 of file DataParameter.cs.

◆ data_noise_param

DataNoiseParameter MyCaffe.param.DataParameter.data_noise_param
getset

Specifies the DataNoiseParameter used when 'enable_noise_for_nonmatch' = True.

Definition at line 267 of file DataParameter.cs.

◆ display_timing

bool MyCaffe.param.DataParameter.display_timing
getset

(optional, default = false) Specifies whether or not to display the timing of each image read.

Definition at line 148 of file DataParameter.cs.

◆ enable_debug_output

bool MyCaffe.param.DataParameter.enable_debug_output
getset

(optional, default = false) When true the data sent out through the top are saved as images into the debug directory specified by the data_debug_param.

Definition at line 277 of file DataParameter.cs.

◆ enable_noise_for_nonmatch

bool MyCaffe.param.DataParameter.enable_noise_for_nonmatch
getset

(optional, default = false) When true an image consisting of noise initialized with noise filler.

Definition at line 257 of file DataParameter.cs.

◆ enable_pair_selection

bool? MyCaffe.param.DataParameter.enable_pair_selection
getset

(optional, default = null) Specifies whether or not to select images in a pair sequence. When enabled, the first image queried is queried using the 'random' selection property, and then the second image queried is the image just after the first image queried (even if queried randomly).

Definition at line 138 of file DataParameter.cs.

◆ enable_random_selection

bool? MyCaffe.param.DataParameter.enable_random_selection
getset

(optional, default = null) Specifies whether or not to randomly query images from the data source. When enabled, images are queried in sequence which can often have poorer training results.

Definition at line 128 of file DataParameter.cs.

◆ forced_primary_label

int MyCaffe.param.DataParameter.forced_primary_label
getset

(optional, default = -1) When >= 0, this label is used as the primary image label when 'images_per_blob' > 1.

Definition at line 247 of file DataParameter.cs.

◆ images_per_blob

int MyCaffe.param.DataParameter.images_per_blob
getset

(optional, default = 1) Specifies the number of images to load into each blob channel. For example when set to 2 two 3 channel images are loaded and stacked on the channel dimension, thus loading a 6 channel blob (2 images x 3 channels each).

Loading images in pairs (images_per_blob = 2) is used with the siamese network, where the channel of each blob contains the first image followed by the second image. The total individual image channel count equals the blob channel count divided by 2.

Definition at line 207 of file DataParameter.cs.

◆ label_type

LABEL_TYPE MyCaffe.param.DataParameter.label_type
getset

(optional, default = SINGLE) Specifies the label type: SINGLE - the default which uses the 'Label' field, or MULTIPLE - which uses the 'DataCriteria' field.

Definition at line 158 of file DataParameter.cs.

◆ one_hot_label_size

int MyCaffe.param.DataParameter.one_hot_label_size
getset

When greater than 0 (default = 0), labels are one-hot encoded to a vector of the one-hot label size (e.g., when size = 4: 3 -> 0 1 1 0; 4 -> 1 0 0 0)

Definition at line 297 of file DataParameter.cs.

◆ output_all_labels

bool MyCaffe.param.DataParameter.output_all_labels
getset

(optional, default = false) When using images_per_blob > 1, 'output_all_labels' specifies to output all labels for the stacked images instead of just the comparison.

Definition at line 217 of file DataParameter.cs.

◆ output_image_information

bool MyCaffe.param.DataParameter.output_image_information
getset

(optional, default = false) When true image information such as index and label are output. IMPORTANT: enabling this setting can dramatically slow down training and is only used for debugging.

Definition at line 237 of file DataParameter.cs.

◆ prefetch

uint MyCaffe.param.DataParameter.prefetch
getset

Prefetch queue (Number of batches to prefetch to host memory, increase if data access bandwidth varies).

Definition at line 118 of file DataParameter.cs.

◆ primary_data

bool MyCaffe.param.DataParameter.primary_data
getset

(optional, default = true) Specifies whether or not the data is the primary datset as opposed to a secondary, target dataset.

Definition at line 168 of file DataParameter.cs.

◆ source

string MyCaffe.param.DataParameter.source
getset

When used with the DATA parameter, specifies the data 'source' within the database. Some sources are used for training whereas others are used for testing. When used with the IMAGE_DATA parameter, the 'source' specifies the data 'source' file containing the list of image file names. Each dataset has both a training and testing data source.

Definition at line 72 of file DataParameter.cs.

◆ synchronize_target

bool MyCaffe.param.DataParameter.synchronize_target
getset

(optional, default = false) Specifies whether or not this is a to be synchronized with another data layer as the target.

Definition at line 178 of file DataParameter.cs.

◆ synchronize_with

string MyCaffe.param.DataParameter.synchronize_with
getset

(optional, default = null) Specifies a secondary (target) dataset to syncrhonize with.

When synchronizing with another dataset the ordering of labels is guaranteed to be the same from both data sets even though the images selected are selected at random.

Definition at line 192 of file DataParameter.cs.

Event Documentation

◆ OnVerifyBatchSize

EventHandler<VerifyBatchSizeArgs> MyCaffe.param.DataParameter.OnVerifyBatchSize

This event is, optionally, called to verify the batch size of the DataParameter.

Definition at line 61 of file DataParameter.cs.


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