2using System.Collections.Generic;
54 throw new Exception(
"Currently only image databases are supported by the BaseDataLayer.");
67 m_log.
WriteLine(
"WARNING: The image database is NULL, and therefore no mean image can not be acquired.");
113 if (colTop.
Count == 1)
164 if (nC == 0 && nH == 0 && nW == 0)
165 throw new Exception(
"The sizing of C, H, W cannot be zero for all three!");
The Log class provides general output in text form.
void WriteLine(string str, bool bOverrideEnabled=false, bool bHeader=false, bool bError=false, bool bDisable=false)
Write a line of output.
The SimpleDatum class holds a data input within host memory.
int Channels
Return the number of channels of the data.
int Width
Return the width of the data.
int Height
Return the height of the data.
int ID
Get/set the database ID of the item.
The SourceDescriptor class contains all information describing a data source.
int Height
Returns the height of each data item in the data source.
int Width
Returns the width of each data item in the data source.
int Channels
Returns the item colors - 1 channel = black/white, 3 channels = RGB color.
The BlobCollection contains a list of Blobs.
int Count
Returns the number of items in the collection.
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
The BaseDataLayer is the base class for data Layers that feed Blobs of data into the Net.
SimpleDatum m_imgMean
Specifies the SimpleDatum that optionally contains the image Mean for data centering.
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Implements common data layer setup functionality, and calls DataLayerSetUp to do special data layer s...
bool m_bOutputLabels
Specifies whether or not the Layer should output labels.
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Not implemented - data Layers do not perform backward.
SourceDescriptor m_src
Specifies the SourceDescriptor of the data source.
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Data layers have no bottoms, so reshaping is trivial.
virtual bool setupSourceDescriptor()
Allows any derivative classes to pre-initialize the m_src which is used in LayerSetup before the Data...
IXImageDatabaseBase m_imgdb
Specifies the MyCaffeImageDatabase.
override void dispose()
Releases all GPU and host resources used by the Layer.
DataTransformer< T > m_transformer
Specifies the DataTransformer used to transform each data item as it loaded.
DataTransformer< T > Transformer
Returns the data transformer used.
SimpleDatum ImageMean
Get/set the image mean.
abstract void DataLayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Override this method to perform the actual data loading.
BaseDataLayer(CudaDnn< T > cuda, Log log, LayerParameter p, IXDatabaseBase db)
The BaseDataLayer constructor.
An interface for the units of computation which can be composed into a Net.
Log m_log
Specifies the Log for output.
LayerParameter m_param
Specifies the LayerParameter describing the Layer.
CudaDnn< T > m_cuda
Specifies the CudaDnn connection to Cuda.
string source
When used with the DATA parameter, specifies the data 'source' within the database....
List< uint > channels
DEPRECIATED - 4D dimensions, use 'shape' instead.
List< uint > height
>DEPRECIATED - 4D dimensions, use 'shape' instead.
Specifies the base parameter for all layers.
LayerType type
Specifies the type of this LayerParameter.
DummyDataParameter dummy_data_param
Returns the parameter set when initialized with LayerType.DUMMYDATA
MemoryDataParameter memory_data_param
Returns the parameter set when initialized with LayerType.MEMORY_DATA
InputParameter input_param
Returns the parameter set when initialized with LayerType.INPUT
TransformationParameter transform_param
Returns the parameter set when initialized with LayerType.TRANSFORM
DataParameter data_param
Returns the parameter set when initialized with LayerType.DATA
VideoDataParameter video_data_param
Returns the parameter set when initialized with LayerType.VIDEO_DATA
Phase phase
Specifies the Phase for which this LayerParameter is run.
LayerType
Specifies the layer type.
uint width
The width of the data.
uint channels
The number of channels in the data.
uint height
The height of the data.
The IXDatabaseBase interface defines the general interface to the in-memory database.
SimpleDatum GetItemMean(int nSrcId)
Returns the item (e.g., image or temporal item) mean for a data source.
SourceDescriptor GetSourceByName(string strSrc)
Returns the SourceDescriptor for a given data source name.
DB_VERSION GetVersion()
Returns the version of the MyCaffe Image Database being used.
The IXImageDatabaseBase interface defines the general interface to the in-memory image database.
The descriptors namespace contains all descriptor used to describe various items stored within the da...
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
DB_VERSION
Defines the image database version to use.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.data namespace contains dataset creators used to create common testing datasets such as M...
The MyCaffe.db.image namespace contains all image database related classes.
The MyCaffe.layers namespace contains all layers that have a solidified code base,...
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...