MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.Blob< T > Class Template Reference

The Blob is the main holder of data that moves through the Layers of the Net. More...

Inheritance diagram for MyCaffe.common.Blob< T >:

Public Member Functions

 Blob (CudaDnn< T > cuda, Log log, bool bIncludeDiff=true, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (CudaDnn< T > cuda, Log log, int nNum, int nChannels, int nHeight, int nWidth, bool bIncludeDiff=true, bool bUseHalfSize=false)
 DEPRECIATED; use More...
 
 Blob (CudaDnn< T > cuda, Log log, List< int > rgShape, bool bIncludeDiff=true, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (CudaDnn< T > cuda, Log log, int[] rgShape, bool bIncludeDiff=true, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (CudaDnn< T > cuda, Log log, Blob< T > b, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (CudaDnn< T > cuda, Log log, SimpleDatum d, bool bCopyData=false, bool bIncludeDiff=true, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (CudaDnn< T > cuda, Log log, BlobProto bp, bool bUseHalfSize=false)
 The Blob constructor. More...
 
 Blob (Blob< T > blob, long lCount, long lOffset)
 The Blob constructor used to copy another blob by creating memory pointers to its data thus sharing the same GPU memory. More...
 
void Unsqueeze (int nNumAxes)
 Unsqueeze the shape by adding shape=1 on each axis until the 'nNumAxes' is reached. More...
 
double? GetParameter (string strName)
 Get a blob parameter. More...
 
void SetParameter (string strName, double dfVal)
 Set a blob parameter. More...
 
void CopyParameters (Blob< T > b)
 Copy the parameters from another blob. More...
 
ulong GetConversionWorkSize (bool bUseHalfSize)
 Returns the amount of memory (in bytes) required to convert from base to half and back. More...
 
void ConvertToHalf (long hWorkMem, ulong lWorkSize, bool bData, bool bDiff)
 Converts this blob from its base type to the half type. More...
 
void ConvertToBase (long hWorkMem, ulong lWorkSize, bool bData, bool bDiff)
 Converts this blob from the half type to the base type. More...
 
void Dispose ()
 Releases all resources used by the Blob (including both GPU and Host). More...
 
void Reshape (int nNum, int nChannels, int nHeight, int nWidth, bool? bUseHalfSize=null)
 DEPRECIATED; use More...
 
void Reshape (List< int > rgShape, bool? bUseHalfSize=null)
 Change the dimensions of the blob, allocating new memory if necessary. More...
 
void Reshape (int[] rgShape, bool? bUseHalfSize=null)
 Change the dimensions of the blob, allocating new memory if necessary. More...
 
void Reshape (BlobShape shape, bool? bUseHalfSize=null)
 Change the dimensions of the blob, allocating new memory if necessary. More...
 
void ReshapeLike (Blob< T > b, bool? bUseHalfSize=null)
 Reshape this Blob to have the same shape as another Blob. More...
 
List< int > shape ()
 Returns an array where each element contains the shape of an axis of the Blob. More...
 
int shape (int nIdx)
 Returns the dimension of the nIdx'th axis (or the negative nIdx'th axis from teh end, if nIdx is negative. More...
 
int count ()
 Returns the total number of items in the Blob. More...
 
int count (int nStartIdx, int nEndIdx)
 Compute the volume of a slice; i.e., the product of dimensions among a range of axes. More...
 
int count (int nStartIdx)
 Compute the volume of a slice spanning from a particular first axis to the final axis. More...
 
int CanonicalAxisIndex (int nIdx)
 Returns the 'canonical' version of a (usually) user-specified axis, allowing for negative indexing (e.g., -1 for the last axis). More...
 
int LegacyShape (int nIdx)
 Returns the legacy shape at a given axis. More...
 
int offset (int n, int c=0, int h=0, int w=0)
 Returns the flat offset given the number, channel, height and width. More...
 
int offset (List< int > rgIdx)
 Returns the flat offset given the array of axes values. More...
 
void CopyFrom (Blob< T > src, int nSrcOffset, int nDstOffset, int nCount, bool bCopyData, bool bCopyDiff)
 Copy from a source Blob. More...
 
long CopyFrom (Blob< T > src, bool bCopyDiff=false, bool bReshape=false, long hDstHostBuffer=0, bool bIgnoreShape=false)
 Copy from a source Blob. More...
 
void CopyFromAndPad (Blob< T > src, double dfPad=0, bool bCopyDiff=false)
 Copy the source data to this Blob, and if this blob is larger than the source, pad this blob with 'dfPad' values to the right. More...
 
void CopyFromAndTransposeHeightWidth (Blob< T > blobSrc, bool bCopyDiff=false, bool bUseCuda=true)
 Copy from a source Blob and transpose the height and width of the copy. More...
 
void CopyFrom (Blob< T > blobSrc, int nChannelFrom, int nChannelTo, bool bCopyDiff=false)
 Copy all data along a given channel from the source. More...
 
bool Compare (Blob< T > other, Blob< T > work, bool bDiff=false, double dfTol=1e-8, bool bZeroCheck=true, bool bFullCompare=false, bool bDetectNans=true, bool bForceOtherData=false)
 Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not. More...
 
bool CompareEx (Blob< T > other, Blob< T > work, out double dfMin, out double dfMax, bool bDiff=false, double dfTol=1e-8, bool bZeroCheck=true, bool bFullCompare=false, bool bDetectNans=true, bool bForceOtherData=false)
 Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not. More...
 
bool ValidateData (Blob< T > work, bool bDiff=false)
 Validate the data or diff looking for NAN or Inf. More...
 
bool Compare (CudaDnn< double > cuda, Blob< T > other, Blob< double > work, bool bDiff=false, double dfTol=1e-8)
 Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not. More...
 
data_at (int n, int c, int h, int w)
 Returns the data at a given location in the Blob. More...
 
diff_at (int n, int c, int h, int w)
 Returns the diff at a given location in the Blob. More...
 
data_at (List< int > rgIdx)
 Returns the data at a given location in the Blob. More...
 
diff_at (List< int > rgIdx)
 Returns the diff at a given location in the Blob. More...
 
T[] update_cpu_data ()
 Update the CPU data by transferring the GPU data over to the Host. More...
 
T[] update_cpu_diff ()
 Update the CPU diff by transferring the GPU diff over to the Host. More...
 
void Update ()
 The 'update' method is used for parameter blobs in a Net. More...
 
void FromProto (BlobProto bp, bool bReshape=true)
 Create a new Blob from a given BlobProto. More...
 
BlobProto ToProto (bool bWriteDiff=false)
 Writes the Blob to a new BlobProto. More...
 
asum_data ()
 Compute the sum of absolute values (L1 norm) of the data. More...
 
asum_diff ()
 Compute the sum of absolute values (L1 norm) of the diff. More...
 
sumsq_data ()
 Calcualte the sum of squares (L2 norm squared) of the data. More...
 
sumsq_diff ()
 Calcualte the sum of squares (L2 norm squared) of the diff. More...
 
void scale_data (double df)
 Scale the data by a scaling factor. More...
 
void scale_diff (double df)
 Scale the diff by a scaling factor. More...
 
void scale_to_range (double dfMin, double dfMax)
 Scale the data in the blob to the range [dfMin,dfMax]. More...
 
void scale_data (T fScaleFactor)
 Scale the blob data by a constant factor. More...
 
void scale_diff (T fScaleFactor)
 Scale the blob diff by a constant factor. More...
 
void ShareData (Blob< T > b)
 Set the data to point to the data of the other blob – useful in Layers which simply perform a copy in their forward pass. More...
 
void ShareDiff (Blob< T > b)
 Set the diff to point to the diff of the other blob – useful in Layers which simply perform a copy in their forward pass. More...
 
void Share (Blob< T > b)
 Share another Blob with this one, by setting the data and diff to the same data and diff of the other Blob. More...
 
GetData (int nIdx)
 Returns the data at a given flat index within the Blob. More...
 
GetDiff (int nIdx)
 Returns the diff at a given flat index within the Blob. More...
 
void SetData (T[] rgData, int nCount=-1, bool bSetCount=true)
 Sets a number of items within the Blob's data. More...
 
void SetData (T fVal, int nIdx=-1)
 Either sets all of the data items in the Blob to a given value, or alternatively only sets a single indexed item to a given value. More...
 
void SetData (double dfVal, int nIdx=-1)
 Either sets all of the data items in the Blob to a given value, or alternatively only sets a single indexed item to a given value. More...
 
void SetData (double dfVal, int nStartIdx, int nCount)
 Set a data range with a given value. More...
 
void SetDiff (double dfVal, int nIdx=-1)
 Either sets all of the diff items in the Blob to a given value, or alternatively only sets a single indexed item to a given value. More...
 
void SetDiff (double dfVal, int nStartIdx, int nCount)
 Set a diff range with a given value. More...
 
void SetDiff (T[] rgDiff, int nCount=-1, bool bSetCount=true)
 Sets a number of items within the Blob's diff. More...
 
void SetData (SimpleDatum d, bool bReshape, bool bCopyData=true)
 Sets the Blob values to the data contained within a SimpleDatum. More...
 
void SetCPUData (T[] rg)
 Sets just the CPU data to the data specified. More...
 
void AsyncGpuPush (long hStream)
 Asynchronously pushes the CPU data, previously set with SetCPUData, to the GPU. More...
 
bool ShapeEquals (BlobProto bp)
 Compares the shape of this blob to the shape within a BlobProto. More...
 
bool CompareShape (List< int > rgShape, bool bCompareCpuDataLen=false)
 Compares the shape of this blob to another shape. More...
 
bool CompareShape (int[] rgShape, bool bCompareCpuDataLen=false)
 Compares the shape of this blob to another shape. More...
 
string ToSizeString ()
 Returns a string describing the 4D shape of the Blob. More...
 
Datum ToDatum ()
 Returns a new Datum that contains the shape and data of the Blob. More...
 
Blob< T > Clone ()
 Copies the Blob, including its data and diff. More...
 
Blob< T > MathAdd (Blob< T > blobA, T fScale)
 Clones the input Blob, scales the clone and then adds the data from this Blob to it. More...
 
Blob< T > MathSub (Blob< T > blobA)
 Clones the input Blob and subtracts the data from this blob from it. More...
 
Blob< T > MathDiv (T fScale)
 Clones the input Blob and divides a scalar from all of the clones data items. More...
 
void SaveBinary (string strFile, bool bData, bool bDiff, bool bIncludeName=true)
 Saves the blob to a binary file. More...
 
void Save (BinaryWriter bw, bool bData, bool bDiff, bool bIncludeName=true)
 Saves this Blob to a binary stream. More...
 
byte[] ToByteArray ()
 Saves this Blob to a byte array. More...
 
override string ToString ()
 Returns a string representation of the Blob. More...
 
string ToString (int nMax, bool bDiff=false)
 Get the string representation containing up to the first 'nMax' items. More...
 
double GetMinData (out long lPos)
 Returns the minimum data and the position where the minimum is located in the data. More...
 
double GetMaxData (out long lPos)
 Returns the maximum data and the position where the maximum is located in the data. More...
 
double GetMinDiff (out long lPos)
 Returns the minimum diff and the position where the minimum is located in the diff. More...
 
double GetMaxDiff (out long lPos)
 Returns the maximum diff and the position where the maximum is located in the diff. More...
 
Tuple< double, double, double, double > minmax_data (Blob< T > work, bool bDetectNans=false, bool bUseChunks=false)
 Returns the minimum and maximum values in the data of the Blob. More...
 
Tuple< double, double, double, double > minmax_diff (Blob< T > work, bool bDetectNans=false, bool bUseChunks=false)
 Returns the minimum and maximum values in the diff of the Blob. More...
 
void add_scalar (double dfVal)
 Adds a scalar value to the Blob. More...
 
Blob< T > Resize (List< int > rgShape)
 The Resize method resizes the 3rd and 4th axes of the blob. More...
 
void NormalizeData (double? dfMean=null, double? dfStd=null)
 Normalize the blob data by subtracting the mean and dividing by the standard deviation. More...
 
double mean (float[] rgDf=null, bool bDiff=false)
 Calculate the mean of the blob data. More...
 
double sum (float[] rgDf=null, bool bDiff=false)
 Calculate the sum of the blob data. More...
 
double std (double? dfMean=null, float[] rgDf=null)
 Calculate the standard deviation of the blob data. More...
 
Tuple< T, T, T > SetPixel (int nX, int nY, byte R, byte G, byte B, TransformationParameter.COLOR_ORDER order=TransformationParameter.COLOR_ORDER.RGB)
 Set the values of a 3 channel image embedded within the blob in the order RGB or BGR where the full hxw is stored for each color in order. More...
 
Tuple< T, T, T > SetPixel (int nX, int nY, Tuple< T, T, T > pixel, bool bReturnOriginal=false, TransformationParameter.COLOR_ORDER order=TransformationParameter.COLOR_ORDER.RGB, int nOffset=0)
 Sets a pixel to the values within a three item tuple where the first item is assigned RED, second GREEN and third BLUE. More...
 
void SaveToImage (string strFile, bool bNonZeroExistOnly=true, bool bSaveDiff=false, Dictionary< float, Color > rgSpecialValues=null)
 Save the Blob to an image where values less than 0 are colored red, and values greater than 0 are colored green. Values = 0 are colored black. More...
 
void SaveToNumpy (string strFile, bool bSaveDiff=false)
 Save a blob with data to a Numpy .npy file. More...
 
Tuple< float[], int[]> LoadFromNumpy (string strFile, bool bLoadDiff=false, bool bLoadDataOnly=false, Log log=null, int nMax=int.MaxValue)
 Load a blob with data from a Numpy array .npy file. More...
 
void MatMul (Blob< T > blobA, Blob< T > blobB, bool bReshape=false, bool bTransA=false, bool bTransB=false, double dfScale=1.0, bool bADiff=false, bool bBDiff=false, bool bCDiff=false)
 MatMul blobA with blobB and place the result in this blob (e.g. this = matmul(A, B)). All blobs are in row-major format. More...
 
void MatMulGrad (Blob< T > blobA, Blob< T > blobB, Blob< T > blobWork, double dfScale=1.0)
 Calculates and propagates the gradient for blobA and BlobB given the input gradient in this blob's diff values. After this call, the blobA and blobB diff values are filled with their respective gradients. More...
 
void Percentile (Blob< T > blobY, double dfPercentile)
 Calculates the percentile and places the result in blobY. More...
 

Static Public Member Functions

static Blob< T > LoadBinary (CudaDnn< T > cuda, Log log, string strFile, bool bData, bool bDiff)
 Loads a blob from a binary file (previously saved with SaveBinary). More...
 
static Blob< T > Load (CudaDnn< T > cuda, Log log, BinaryReader br, bool bData, bool bDiff)
 Lods a new Blob from a binary reader. More...
 
static Blob< T > FromByteArray (CudaDnn< T > cuda, Log log, byte[] rg)
 A new Blob is created from the byte array, previously saved with ToByteArray. More...
 
static void SaveToNumpy (string strFile, float[] rgData, int[] rgShape)
 Save a blob with data to a Numpy .npy file. More...
 
static void SaveToNumpy (string strFile, int[] rgData, int[] rgShape)
 Save a blob with data to a Numpy .npy file. More...
 
static void SaveToNumpy (string strFile, long[] rgData, int[] rgShape)
 Save a blob with data to a Numpy .npy file. More...
 
static Tuple< List< float[]>, int[], List< string > > LoadFromNumpy (string strFile, Log log=null, int nMax=int.MaxValue, int nStartIdx=0, int nCount=int.MaxValue)
 Load the long, int, bool, float, or double data from a very large Numpy array .npy file, reading in col order. More...
 

Static Public Attributes

const int MAX_BLOB_AXES = 32
 Defines the maximum number of Axes supported by the Blob. More...
 

Protected Member Functions

virtual void Dispose (bool bDisposing)
 Releases all resources used by the Blob (including both GPU and Host). More...
 

Properties

static T Zero [get]
 Returns Zero (0) in type T. More...
 
static T One [get]
 Returns One (1) in type T. More...
 
static T MinusOne [get]
 Returns MinusOne (-1) in type T. More...
 
bool Padded [getset]
 Get/set the padding state of the blob. More...
 
bool HalfSize [get]
 Returns whether or not this blob is using half sizes. More...
 
bool freeze_learning [getset]
 Specifies whether or not the diff is applied to the data during Update. When freeze learning = true, the update is skipped. More...
 
CudaDnn< T > Cuda [get]
 Returns the CudaDnn object that manages the Blob's memory."/> More...
 
Log Log [get]
 Returns the Log associated with the blob. More...
 
string shape_string [get]
 Returns a string describing the Blob's shape. More...
 
bool DiffExists [get]
 Returns whether or not the Diff portion exists. More...
 
int num_axes [get]
 Returns the number of axes in the Blob. More...
 
int num_true_axes [get]
 Returns the number of true axes, ignoring the trailing ones. More...
 
int num [get]
 DEPRECIATED; legacy shape accessor num: use shape(0) instead. More...
 
int channels [get]
 DEPRECIATED; legacy shape accessor channels: use shape(1) instead. More...
 
int height [get]
 DEPRECIATED; legacy shape accessor height: use shape(2) instead. More...
 
int width [get]
 DEPRECIATED; legacy shape accessor width: use shape(3) instead. More...
 
SyncedMemory< T > data [get]
 Returns the SyncedMemory that stores the data. More...
 
SyncedMemory< T > diff [get]
 Returns the SyncedMemory that stores the diff. More...
 
T[] cpu_data [get]
 Returns the last host data retrieved from the GPU. More...
 
T[] mutable_cpu_data [getset]
 Get data from the GPU and bring it over to the host, or Set data from the Host and send it over to the GPU. More...
 
long gpu_data [get]
 Returns the data GPU handle used by the CudaDnn connection. More...
 
long mutable_gpu_data [get]
 Returns the data GPU handle used by the CudaDnn connection. More...
 
T[] cpu_diff [get]
 Returns the last host diff retrieved from the GPU. More...
 
T[] mutable_cpu_diff [getset]
 Get diff from the GPU and bring it over to the host, or Set diff from the Host and send it over to the GPU. More...
 
long gpu_diff [get]
 Returns the diff GPU handle used by the CudaDnn connection. More...
 
long mutable_gpu_diff [get]
 Returns the diff GPU handle used by the CudaDnn connection. More...
 
long gpu_shape [get]
 Returns the shape GPU handle used by the CudaDnn connection. The shape data contains the shape information of the Blob for use in GPU operations. More...
 
bool reshape_when_sharing [getset]
 When true, this Blob is reshaped to the source when sharing the source data (default = false). More...
 
bool snapshot_requested [getset]
 Get/set the snapshot request. More...
 
string Name [getset]
 Get/set the name of the Blob. More...
 
double min_data [get]
 Returns the minimum value in the data of the Blob. More...
 
double max_data [get]
 Returns the maximum value in the data of the Blob. More...
 
double min_diff [get]
 Returns the minimum value in the diff of the Blob. More...
 
double max_diff [get]
 Returns the maximum value in the diff of the Blob. More...
 
BLOB_TYPE type [getset]
 Returns the BLOB_TYPE of the Blob. More...
 
object Tag [getset]
 Returns a user defined object associated with the Blob. More...
 

Detailed Description

The Blob is the main holder of data that moves through the Layers of the Net.

Each blob holds Data and optionally Diff where the data is passed through the Net Layers on each forward pass, and the Diff contains the errors passed backward through the Net Layers on the backward pass.

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.

Definition at line 24 of file Blob.cs.

Constructor & Destructor Documentation

◆ Blob() [1/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
bool  bIncludeDiff = true,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
bIncludeDiffOptionally, specifies whether or not to include (and allocate) the Diff data.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 64 of file Blob.cs.

◆ Blob() [2/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
int  nNum,
int  nChannels,
int  nHeight,
int  nWidth,
bool  bIncludeDiff = true,
bool  bUseHalfSize = false 
)

DEPRECIATED; use

Blob(...,rgShape) instead.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
nNumSpecifies the number of inputs.
nChannelsSpecifies the number of channels per input.
nHeightSpecifies the height of each input.
nWidthSpecifies the width of each input.
bIncludeDiffOptionally, specifies whether or not to include (and allocate) the Diff data.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 98 of file Blob.cs.

◆ Blob() [3/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
List< int >  rgShape,
bool  bIncludeDiff = true,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
rgShapeSpecifies the shape of each axis of the Blob.
bIncludeDiffOptionally, specifies whether or not to include (and allocate) the Diff data.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 115 of file Blob.cs.

◆ Blob() [4/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
int[]  rgShape,
bool  bIncludeDiff = true,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
rgShapeSpecifies the shape of each axis of the Blob.
bIncludeDiffOptionally, specifies whether or not to include (and allocate) the Diff data.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 131 of file Blob.cs.

◆ Blob() [5/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
Blob< T >  b,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
bCreate this blob to be like another Blob (e.g. same shape).
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 146 of file Blob.cs.

◆ Blob() [6/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
SimpleDatum  d,
bool  bCopyData = false,
bool  bIncludeDiff = true,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
dSpecifies the datum for which the Blob is shaped to match.
bCopyDataOptionally, specifies whether or not to actually copy the data. When false, the shape is set, but no data is copied.
bIncludeDiffOptionally, specifies whether or not to include (and allocate) the Diff data.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 163 of file Blob.cs.

◆ Blob() [7/8]

MyCaffe.common.Blob< T >.Blob ( CudaDnn< T >  cuda,
Log  log,
BlobProto  bp,
bool  bUseHalfSize = false 
)

The Blob constructor.

Parameters
cudaSpecifies the CudaDnn instance used to communidate with Cuda.
logSpecifies the Log for output.
bpSpecifies the BlobProto used to load the Blob.
bUseHalfSizeOptionally, specifies to use half size (FP16) for both data and diff. This option is only available when using the float base type 'T'.

Definition at line 176 of file Blob.cs.

◆ Blob() [8/8]

MyCaffe.common.Blob< T >.Blob ( Blob< T >  blob,
long  lCount,
long  lOffset 
)

The Blob constructor used to copy another blob by creating memory pointers to its data thus sharing the same GPU memory.

Parameters
blobSpecifies the blob whos data is to be shared.
lCountSpecifies the number of items to share.
lOffsetSpecifies the offset into the blob where the shareing starts.

Definition at line 188 of file Blob.cs.

Member Function Documentation

◆ add_scalar()

void MyCaffe.common.Blob< T >.add_scalar ( double  dfVal)

Adds a scalar value to the Blob.

Parameters
dfValSpecifies the scalar value.

Definition at line 2779 of file Blob.cs.

◆ asum_data()

T MyCaffe.common.Blob< T >.asum_data ( )

Compute the sum of absolute values (L1 norm) of the data.

Returns

Definition at line 1706 of file Blob.cs.

◆ asum_diff()

T MyCaffe.common.Blob< T >.asum_diff ( )

Compute the sum of absolute values (L1 norm) of the diff.

Returns

Definition at line 1718 of file Blob.cs.

◆ AsyncGpuPush()

void MyCaffe.common.Blob< T >.AsyncGpuPush ( long  hStream)

Asynchronously pushes the CPU data, previously set with SetCPUData, to the GPU.

Parameters
hStreamSpecifies a handle to the Cuda Stream to use for synchronization.

Definition at line 2062 of file Blob.cs.

◆ CanonicalAxisIndex()

int MyCaffe.common.Blob< T >.CanonicalAxisIndex ( int  nIdx)

Returns the 'canonical' version of a (usually) user-specified axis, allowing for negative indexing (e.g., -1 for the last axis).

Parameters
nIdxThe axis index.
Returns
The zero based index is returned.

Definition at line 780 of file Blob.cs.

◆ Clone()

Blob< T > MyCaffe.common.Blob< T >.Clone ( )

Copies the Blob, including its data and diff.

Returns
A new copy of the Blob is returned.

Definition at line 2202 of file Blob.cs.

◆ Compare() [1/2]

bool MyCaffe.common.Blob< T >.Compare ( Blob< T >  other,
Blob< T >  work,
bool  bDiff = false,
double  dfTol = 1e-8,
bool  bZeroCheck = true,
bool  bFullCompare = false,
bool  bDetectNans = true,
bool  bForceOtherData = false 
)

Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not.

Parameters
otherSpecifies the other blob to compare.
workSpecifies a temporary work blob.
bDiffSpecifies to compare the diff.
dfTolSpecifies the accepted tolerance.
bZeroCheckOptionally, specifies to check for all zeros (default = false).
bFullCompareOptionally, compare each item individually (default = false).
bDetectNansOptionally, detect NAN's (default = true).
bForceOtherDataOptionally, force using the other blobs data even when bDiff = true.
Returns
If all data (or diff) values fall within the tolerance, true is returned, otherwise false.

Definition at line 1093 of file Blob.cs.

◆ Compare() [2/2]

bool MyCaffe.common.Blob< T >.Compare ( CudaDnn< double >  cuda,
Blob< T >  other,
Blob< double >  work,
bool  bDiff = false,
double  dfTol = 1e-8 
)

Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not.

Parameters
cudaSpecifies a double precision CudaDnn.
otherSpecifies the other blob to compare.
workSpecifies a temporary work blob.
bDiffSpecifies to compare the diff.
dfTolSpecifies the accepted tolerance.
Returns
If all data (or diff) values fall within the tolerance, true is returned, otherwise false.

Definition at line 1220 of file Blob.cs.

◆ CompareEx()

bool MyCaffe.common.Blob< T >.CompareEx ( Blob< T >  other,
Blob< T >  work,
out double  dfMin,
out double  dfMax,
bool  bDiff = false,
double  dfTol = 1e-8,
bool  bZeroCheck = true,
bool  bFullCompare = false,
bool  bDetectNans = true,
bool  bForceOtherData = false 
)

Compare the data (or diff) of one blob to another and return true if all items fall within the specified tolerance or not.

Parameters
otherSpecifies the other blob to compare.
workSpecifies a temporary work blob.
dfMinReturns the min difference.
dfMaxReturns the max difference.
bDiffSpecifies to compare the diff.
dfTolSpecifies the accepted tolerance.
bZeroCheckOptionally, specifies to check for all zeros (default = false).
bFullCompareOptionally, compare each item individually (default = false).
bDetectNansOptionally, detect NAN's (default = true).
bForceOtherDataOptionally, force using the other blobs data even when bDiff = true.
Returns
If all data (or diff) values fall within the tolerance, true is returned, otherwise false.

Definition at line 1114 of file Blob.cs.

◆ CompareShape() [1/2]

bool MyCaffe.common.Blob< T >.CompareShape ( int[]  rgShape,
bool  bCompareCpuDataLen = false 
)

Compares the shape of this blob to another shape.

Parameters
rgShapeSpecifies the shape to compare with.
bCompareCpuDataLenOptionally, compare the CPU data length.
Returns
If the shapes are the same, return true, othewise false.

Definition at line 2148 of file Blob.cs.

◆ CompareShape() [2/2]

bool MyCaffe.common.Blob< T >.CompareShape ( List< int >  rgShape,
bool  bCompareCpuDataLen = false 
)

Compares the shape of this blob to another shape.

Parameters
rgShapeSpecifies the shape to compare with.
bCompareCpuDataLenOptionally, compare the CPU data length.
Returns
If the shapes are the same, return true, othewise false.

Definition at line 2108 of file Blob.cs.

◆ ConvertToBase()

void MyCaffe.common.Blob< T >.ConvertToBase ( long  hWorkMem,
ulong  lWorkSize,
bool  bData,
bool  bDiff 
)

Converts this blob from the half type to the base type.

Parameters
hWorkMemSpecifies the work memory.
lWorkSizeSpecifies the work size.
bDataSpecifies to convert the data.
bDiffSpecifies to convert the diff

Definition at line 339 of file Blob.cs.

◆ ConvertToHalf()

void MyCaffe.common.Blob< T >.ConvertToHalf ( long  hWorkMem,
ulong  lWorkSize,
bool  bData,
bool  bDiff 
)

Converts this blob from its base type to the half type.

Parameters
hWorkMemSpecifies the work memory.
lWorkSizeSpecifies the work size.
bDataSpecifies to convert the data.
bDiffSpecifies to convert the diff

Definition at line 306 of file Blob.cs.

◆ CopyFrom() [1/3]

void MyCaffe.common.Blob< T >.CopyFrom ( Blob< T >  blobSrc,
int  nChannelFrom,
int  nChannelTo,
bool  bCopyDiff = false 
)

Copy all data along a given channel from the source.

Parameters
blobSrcSpecifies the source blob to copy from.
nChannelFromSpecifies the channel within the source to copy from.
nChannelToSpecifies the channel in the destination (this blob) to copy into.
bCopyDiffSpecifies whether or not to copy the data or diff.

Definition at line 1054 of file Blob.cs.

◆ CopyFrom() [2/3]

long MyCaffe.common.Blob< T >.CopyFrom ( Blob< T >  src,
bool  bCopyDiff = false,
bool  bReshape = false,
long  hDstHostBuffer = 0,
bool  bIgnoreShape = false 
)

Copy from a source Blob.

Parameters
srcThe Blob to copy from.
bCopyDiffIf false, copy the data; if true, copy the diff.
bReshapeIf false, require this Blob to be pre-shaped to the shape of other (and die otherwise); If true, Reshape this Blob to other's shape if necessary.
hDstHostBufferOptionally, specifies the host buffer of the destination.
bIgnoreShapeOptionally, specifies to ignore the shape and just make sure the count is the same before copying (default = false).
Returns
When used, the host buffer handle is returned.

Definition at line 928 of file Blob.cs.

◆ CopyFrom() [3/3]

void MyCaffe.common.Blob< T >.CopyFrom ( Blob< T >  src,
int  nSrcOffset,
int  nDstOffset,
int  nCount,
bool  bCopyData,
bool  bCopyDiff 
)

Copy from a source Blob.

Parameters
srcThe Blob to copy from.
nSrcOffsetThe offset into the source data to copy.
nDstOffsetThe offset into the destination data to copy.
nCountThe number of items to copy.
bCopyDataCopy the data.
bCopyDiffCopy the diff.

Definition at line 903 of file Blob.cs.

◆ CopyFromAndPad()

void MyCaffe.common.Blob< T >.CopyFromAndPad ( Blob< T >  src,
double  dfPad = 0,
bool  bCopyDiff = false 
)

Copy the source data to this Blob, and if this blob is larger than the source, pad this blob with 'dfPad' values to the right.

Parameters
srcSpecifies the source Blob to copy.
dfPadSpecifies the pad value (default = 0).
bCopyDiffSpecifies to copy the diff values (default = false).

Definition at line 973 of file Blob.cs.

◆ CopyFromAndTransposeHeightWidth()

void MyCaffe.common.Blob< T >.CopyFromAndTransposeHeightWidth ( Blob< T >  blobSrc,
bool  bCopyDiff = false,
bool  bUseCuda = true 
)

Copy from a source Blob and transpose the height and width of the copy.

Parameters
blobSrcSpecifies the Blob to copy from.
bCopyDiffOptionally, specifies to copy and transform the diff instead of the data (default = false).
bUseCudaOptionally, specifies to use CUDA function for transformations (default = true)

Definition at line 1002 of file Blob.cs.

◆ CopyParameters()

void MyCaffe.common.Blob< T >.CopyParameters ( Blob< T >  b)

Copy the parameters from another blob.

Parameters
bSpecifies the blob whose parameters are to be copied.

Definition at line 245 of file Blob.cs.

◆ count() [1/3]

int MyCaffe.common.Blob< T >.count ( )

Returns the total number of items in the Blob.

Returns

Definition at line 739 of file Blob.cs.

◆ count() [2/3]

int MyCaffe.common.Blob< T >.count ( int  nStartIdx)

Compute the volume of a slice spanning from a particular first axis to the final axis.

Parameters
nStartIdxThe first axis to include in the slice.
Returns

Definition at line 768 of file Blob.cs.

◆ count() [3/3]

int MyCaffe.common.Blob< T >.count ( int  nStartIdx,
int  nEndIdx 
)

Compute the volume of a slice; i.e., the product of dimensions among a range of axes.

Parameters
nStartIdxThe first axis to include in the slice.
nEndIdxThe first axis to exclude from the slice.
Returns

Definition at line 751 of file Blob.cs.

◆ data_at() [1/2]

T MyCaffe.common.Blob< T >.data_at ( int  n,
int  c,
int  h,
int  w 
)

Returns the data at a given location in the Blob.

Parameters
nSpecifies the num.
cSpecifies the channel.
hSpecifies the height.
wSpecifies the width.
Returns
The data item at the location is returned.

Definition at line 1394 of file Blob.cs.

◆ data_at() [2/2]

T MyCaffe.common.Blob< T >.data_at ( List< int >  rgIdx)

Returns the data at a given location in the Blob.

Parameters
rgIdxSpecifies an array of axes.
Returns
The data item at the location is returned.

Definition at line 1417 of file Blob.cs.

◆ diff_at() [1/2]

T MyCaffe.common.Blob< T >.diff_at ( int  n,
int  c,
int  h,
int  w 
)

Returns the diff at a given location in the Blob.

Parameters
nSpecifies the num.
cSpecifies the channel.
hSpecifies the height.
wSpecifies the width.
Returns
The diff item at the location is returned.

Definition at line 1407 of file Blob.cs.

◆ diff_at() [2/2]

T MyCaffe.common.Blob< T >.diff_at ( List< int >  rgIdx)

Returns the diff at a given location in the Blob.

Parameters
rgIdxSpecifies an array of axes.
Returns
The diff item at the location is returned.

Definition at line 1427 of file Blob.cs.

◆ Dispose() [1/2]

void MyCaffe.common.Blob< T >.Dispose ( )

Releases all resources used by the Blob (including both GPU and Host).

Definition at line 429 of file Blob.cs.

◆ Dispose() [2/2]

virtual void MyCaffe.common.Blob< T >.Dispose ( bool  bDisposing)
protectedvirtual

Releases all resources used by the Blob (including both GPU and Host).

Parameters
bDisposingSet to true when disposing the object.

Definition at line 402 of file Blob.cs.

◆ FromByteArray()

static Blob< T > MyCaffe.common.Blob< T >.FromByteArray ( CudaDnn< T >  cuda,
Log  log,
byte[]  rg 
)
static

A new Blob is created from the byte array, previously saved with ToByteArray.

Parameters
cudaSpecifies the cuda connection.
logSpecifies the output log.
rgSpecifies the byte array to convert.
Returns
The new Blob loaded with the data in the byte array is returned.

Definition at line 2453 of file Blob.cs.

◆ FromProto()

void MyCaffe.common.Blob< T >.FromProto ( BlobProto  bp,
bool  bReshape = true 
)

Create a new Blob from a given BlobProto.

Parameters
bpSpecifies the BlobProto to use.
bReshapeSpecifies whether or not to reshape the Blob with the BlobProto shape.

Definition at line 1589 of file Blob.cs.

◆ GetConversionWorkSize()

ulong MyCaffe.common.Blob< T >.GetConversionWorkSize ( bool  bUseHalfSize)

Returns the amount of memory (in bytes) required to convert from base to half and back.

Parameters
bUseHalfSizeSpecifies whether or not we are converting to half size or not.

Definition at line 293 of file Blob.cs.

◆ GetData()

T MyCaffe.common.Blob< T >.GetData ( int  nIdx)

Returns the data at a given flat index within the Blob.

Parameters
nIdxSpecifies the flat index in the range [0,count()-1].
Returns
The data item at the index is returned.

Definition at line 1893 of file Blob.cs.

◆ GetDiff()

T MyCaffe.common.Blob< T >.GetDiff ( int  nIdx)

Returns the diff at a given flat index within the Blob.

Parameters
nIdxSpecifies the flat index in the range [0,count()-1].
Returns
The diff item at the index is returned.

Definition at line 1907 of file Blob.cs.

◆ GetMaxData()

double MyCaffe.common.Blob< T >.GetMaxData ( out long  lPos)

Returns the maximum data and the position where the maximum is located in the data.

Parameters
lPosReturns the location of the maximum.
Returns
Returns the maximum value.

Definition at line 2538 of file Blob.cs.

◆ GetMaxDiff()

double MyCaffe.common.Blob< T >.GetMaxDiff ( out long  lPos)

Returns the maximum diff and the position where the maximum is located in the diff.

Parameters
lPosReturns the location of the maximum.
Returns
Returns the maximum value.

Definition at line 2590 of file Blob.cs.

◆ GetMinData()

double MyCaffe.common.Blob< T >.GetMinData ( out long  lPos)

Returns the minimum data and the position where the minimum is located in the data.

Parameters
lPosReturns the location of the minimum.
Returns
Returns the minimum value.

Definition at line 2512 of file Blob.cs.

◆ GetMinDiff()

double MyCaffe.common.Blob< T >.GetMinDiff ( out long  lPos)

Returns the minimum diff and the position where the minimum is located in the diff.

Parameters
lPosReturns the location of the minimum.
Returns
Returns the minimum value.

Definition at line 2564 of file Blob.cs.

◆ GetParameter()

double? MyCaffe.common.Blob< T >.GetParameter ( string  strName)

Get a blob parameter.

Parameters
strNameSpecifies the name of the blob parameter.
Returns
If the parameter exists it is returned, otherwise null is returned.

Definition at line 220 of file Blob.cs.

◆ LegacyShape()

int MyCaffe.common.Blob< T >.LegacyShape ( int  nIdx)

Returns the legacy shape at a given axis.

Parameters
nIdxSpecifies the axis.
Returns
The shape at a given axis is returned.

Definition at line 825 of file Blob.cs.

◆ Load()

static Blob< T > MyCaffe.common.Blob< T >.Load ( CudaDnn< T >  cuda,
Log  log,
BinaryReader  br,
bool  bData,
bool  bDiff 
)
static

Lods a new Blob from a binary reader.

Parameters
cudaSpecifies the instance of the CudaDnn connection to use.
logSpecifies the Log for output.
brSpecifies the binary reader.
bDataSpecifies whether or not to read in the data.
bDiffSpecifies whether or not to read in the diff.
Returns

Definition at line 2377 of file Blob.cs.

◆ LoadBinary()

static Blob< T > MyCaffe.common.Blob< T >.LoadBinary ( CudaDnn< T >  cuda,
Log  log,
string  strFile,
bool  bData,
bool  bDiff 
)
static

Loads a blob from a binary file (previously saved with SaveBinary).

Parameters
cudaSpecifies the instance of the CudaDnn connection to use.
logSpecifies the Log for output.
strFileSpecifies the file to load the data/diff from.
bDataSpecifies to load the data.
bDiffSpecifies to load the diff.

Definition at line 2359 of file Blob.cs.

◆ LoadFromNumpy() [1/2]

Tuple< float[], int[]> MyCaffe.common.Blob< T >.LoadFromNumpy ( string  strFile,
bool  bLoadDiff = false,
bool  bLoadDataOnly = false,
Log  log = null,
int  nMax = int.MaxValue 
)

Load a blob with data from a Numpy array .npy file.

Parameters
strFileSpecifies the .npy file name.
bLoadDiffSpecifies to load the diff, when false, the data is loaded.
bLoadDataOnlySpecifies to load the data and return it as an array but do not load the gpu memory.
logOptionally, specifies the output log.
nMaxOptionally, specifies the maximum number of items to load.
Exceptions
ExceptionAn exception is thrown when an invalid or unsupported feature is located.
See also
A Simple File Format for NumPy Arrays
Returns
A tuple containing the float[] data and int[] shape is returned.

Definition at line 3473 of file Blob.cs.

◆ LoadFromNumpy() [2/2]

static Tuple< List< float[]>, int[], List< string > > MyCaffe.common.Blob< T >.LoadFromNumpy ( string  strFile,
Log  log = null,
int  nMax = int.MaxValue,
int  nStartIdx = 0,
int  nCount = int.MaxValue 
)
static

Load the long, int, bool, float, or double data from a very large Numpy array .npy file, reading in col order.

Parameters
strFileSpecifies the .npy file name.
logOptionally, specifies the output log.
nMaxOptionally, specifies the maximum number of items to load (default = MaxValue).
nStartIdxOptionally, specifies a start index of items to read (default = 0).
nCountOptionally, specifies the number of items to load from the start index (default = MaxValue).
Exceptions
ExceptionAn exception is thrown when an invalid or unsupported feature is located.
See also
A Simple File Format for NumPy Arrays Note, when loading at a given start index, only the 'nCount' number of items are loaded from the start or the file is read to the end, whichever is sooner.
Returns
A tuple containing the float[,] data and int[] shape is returned.

Definition at line 3578 of file Blob.cs.

◆ MathAdd()

Blob< T > MyCaffe.common.Blob< T >.MathAdd ( Blob< T >  blobA,
fScale 
)

Clones the input Blob, scales the clone and then adds the data from this Blob to it.

Calculation: Y = Clone(blobA) * dfScale + this

Parameters
blobASpecifies the Blob to clone.
fScaleSpecifies the scaling factor to apply to the clone.
Returns
The Blob copy is returned.

Definition at line 2227 of file Blob.cs.

◆ MathDiv()

Blob< T > MyCaffe.common.Blob< T >.MathDiv ( fScale)

Clones the input Blob and divides a scalar from all of the clones data items.

Calculation: Y = Clone(this) * fScale

Parameters
fScaleSpecifies scaling factor.
Returns
The Blob copy is returned.

Definition at line 2264 of file Blob.cs.

◆ MathSub()

Blob< T > MyCaffe.common.Blob< T >.MathSub ( Blob< T >  blobA)

Clones the input Blob and subtracts the data from this blob from it.

Calculation: Y = Clone(blobA) + this

Parameters
blobASpecifies the Blob to clone.
Returns
The Blob copy is returned.

Definition at line 2247 of file Blob.cs.

◆ MatMul()

void MyCaffe.common.Blob< T >.MatMul ( Blob< T >  blobA,
Blob< T >  blobB,
bool  bReshape = false,
bool  bTransA = false,
bool  bTransB = false,
double  dfScale = 1.0,
bool  bADiff = false,
bool  bBDiff = false,
bool  bCDiff = false 
)

MatMul blobA with blobB and place the result in this blob (e.g. this = matmul(A, B)). All blobs are in row-major format.

Parameters
blobASpecifies the first input with last 2 axes size of MxK row-major matrix (first axes must match blobB's)
blobBSpecifies the second input with last 2 axes size of KxN row-major matrix (first axes must match blobA's)
dfScaleSpecifies the scale applied to blobB.
bReshapeSpecifies to reshape this blob the the expected shape (default = false).
bTransASpecifies to transpose A first.
bTransBSpecifies to transpose B first.
bADiffSpecifies to use the diff values in blobA, otherwise the data values are used (default = false).
bBDiffSpecifies to use the diff values in blobB, otherwise the data values are used (default = false).
bCDiffSpecifies to use the diff values in blobC, otherwise the data values are used (default = false).

Definition at line 3922 of file Blob.cs.

◆ MatMulGrad()

void MyCaffe.common.Blob< T >.MatMulGrad ( Blob< T >  blobA,
Blob< T >  blobB,
Blob< T >  blobWork,
double  dfScale = 1.0 
)

Calculates and propagates the gradient for blobA and BlobB given the input gradient in this blob's diff values. After this call, the blobA and blobB diff values are filled with their respective gradients.

Parameters
blobASpecifies the blobA where blobA gradients are placed (in diff values).
blobBSpecifies the blobB where blobB gradients are placed (in diff values).
blobWorkSpecifies a work blob.
dfScaleSpecifies a scale to be applied to the diffs in this blob before the MatMul (default = 1.0).
See also
PyGrad:functions.py by Jake Tae, 2020, GitHub:jaketae/pygrad

Definition at line 3974 of file Blob.cs.

◆ mean()

double MyCaffe.common.Blob< T >.mean ( float[]  rgDf = null,
bool  bDiff = false 
)

Calculate the mean of the blob data.

Parameters
rgDfOptionally, specifies the CPU data to use (default = null).
bDiffOptionally, specifies to use the diff instead of the data.
Returns
The mean is returned.

Definition at line 2965 of file Blob.cs.

◆ minmax_data()

Tuple< double, double, double, double > MyCaffe.common.Blob< T >.minmax_data ( Blob< T >  work,
bool  bDetectNans = false,
bool  bUseChunks = false 
)

Returns the minimum and maximum values in the data of the Blob.

Parameters
workSpecifies a workspace used to optimize the query.
bDetectNansOptionally, specifies whether or not to detect Nan's and Infinity values.
bUseChunksOptionally, specifies whether or not to use the min/max on all of the memory (default) or run in chunks (true).
Returns
A tuple containing the 'min', 'max' and optionally 'number of nans' and 'number of infinity' is returned for the data.

Definition at line 2624 of file Blob.cs.

◆ minmax_diff()

Tuple< double, double, double, double > MyCaffe.common.Blob< T >.minmax_diff ( Blob< T >  work,
bool  bDetectNans = false,
bool  bUseChunks = false 
)

Returns the minimum and maximum values in the diff of the Blob.

Parameters
workSpecifies a workspace used to optimize the query.
bDetectNansOptionally, specifies whether or not to detect Nan's and Infinity values.
bUseChunksOptionally, specifies whether or not to use the min/max on all of the memory (default) or run in chunks (true).
Returns
A tuple containing the 'min', 'max' and optionally 'number of nans' and 'number of infinity' is returned for the data.

Definition at line 2694 of file Blob.cs.

◆ NormalizeData()

void MyCaffe.common.Blob< T >.NormalizeData ( double?  dfMean = null,
double?  dfStd = null 
)

Normalize the blob data by subtracting the mean and dividing by the standard deviation.

Parameters
dfMeanOptionally, specifies a mean value to use (default = null).
dfStdOptionally, specifies a std value to use (default = null).

Definition at line 2942 of file Blob.cs.

◆ offset() [1/2]

int MyCaffe.common.Blob< T >.offset ( int  n,
int  c = 0,
int  h = 0,
int  w = 0 
)

Returns the flat offset given the number, channel, height and width.

Parameters
nSpecifies the num.
cSpecifies the channel.
hSpecifies the height.
wSpecifies the width.
Returns
The flat offset is returned.

Definition at line 850 of file Blob.cs.

◆ offset() [2/2]

int MyCaffe.common.Blob< T >.offset ( List< int >  rgIdx)

Returns the flat offset given the array of axes values.

Parameters
rgIdxSpecifies the array of axes values.
Returns
The flat offset is returned.

Definition at line 873 of file Blob.cs.

◆ Percentile()

void MyCaffe.common.Blob< T >.Percentile ( Blob< T >  blobY,
double  dfPercentile 
)

Calculates the percentile and places the result in blobY.

BlobY is reshaped to size 1xCxH*W.

Parameters
blobYSpecifies blob where the percentile results are placed.
dfPercentileSpecifies the percentile specified in range (0,1].

Definition at line 3992 of file Blob.cs.

◆ Reshape() [1/4]

void MyCaffe.common.Blob< T >.Reshape ( BlobShape  shape,
bool?  bUseHalfSize = null 
)

Change the dimensions of the blob, allocating new memory if necessary.

This function can be called both to create an initial allocation of memory, and to adjust the dimensions of a top blob during Layer::Reshape or Layer::Forward. When changing the size of blob, memory will only be reallocated if sufficient memory does not already exist, and excess memory will not be freed until Dispose is called.

Note that reshaping an input blob and immediately calling Net::Backward is an error; either Net::Forward or Net::Reshape need to be called to propagate the new input shape to higher layers.

Parameters
shapeSpecifies the new shape of the Blob.
bUseHalfSizeOptionally, specifies to use half sized memory.

Definition at line 637 of file Blob.cs.

◆ Reshape() [2/4]

void MyCaffe.common.Blob< T >.Reshape ( int  nNum,
int  nChannels,
int  nHeight,
int  nWidth,
bool?  bUseHalfSize = null 
)

DEPRECIATED; use

Reshape(rgShape) instead.

Parameters
nNum
nChannels
nHeight
nWidth
bUseHalfSizeOptionally, specifies to use half sized memory.

Definition at line 442 of file Blob.cs.

◆ Reshape() [3/4]

void MyCaffe.common.Blob< T >.Reshape ( int[]  rgShape,
bool?  bUseHalfSize = null 
)

Change the dimensions of the blob, allocating new memory if necessary.

This function can be called both to create an initial allocation of memory, and to adjust the dimensions of a top blob during Layer::Reshape or Layer::Forward. When changing the size of blob, memory will only be reallocated if sufficient memory does not already exist, and excess memory will not be freed until Dispose is called.

Note that reshaping an input blob and immediately calling Net::Backward is an error; either Net::Forward or Net::Reshape need to be called to propagate the new input shape to higher layers.

Parameters
rgShapeSpecifies the new shape.
bUseHalfSizeOptionally, specifies to use half sized memory.

Definition at line 583 of file Blob.cs.

◆ Reshape() [4/4]

void MyCaffe.common.Blob< T >.Reshape ( List< int >  rgShape,
bool?  bUseHalfSize = null 
)

Change the dimensions of the blob, allocating new memory if necessary.

This function can be called both to create an initial allocation of memory, and to adjust the dimensions of a top blob during Layer::Reshape or Layer::Forward. When changing the size of blob, memory will only be reallocated if sufficient memory does not already exist, and excess memory will not be freed until Dispose is called.

Note that reshaping an input blob and immediately calling Net::Backward is an error; either Net::Forward or Net::Reshape need to be called to propagate the new input shape to higher layers.

Parameters
rgShapeSpecifies the new shape.
bUseHalfSizeOptionally, specifies to use half sized memory.

Definition at line 562 of file Blob.cs.

◆ ReshapeLike()

void MyCaffe.common.Blob< T >.ReshapeLike ( Blob< T >  b,
bool?  bUseHalfSize = null 
)

Reshape this Blob to have the same shape as another Blob.

Parameters
bSpecifies the other Blob.
bUseHalfSizeOptionally, specifies to use half sized memory.

Definition at line 648 of file Blob.cs.

◆ Resize()

Blob< T > MyCaffe.common.Blob< T >.Resize ( List< int >  rgShape)

The Resize method resizes the 3rd and 4th axes of the blob.

Currently, the Resize method only works on 4 axis blobs. Resize is different from Reshape in that Resize actually averages the data when resizing the blob.

Parameters
rgShapeSpecifies the new shape to resize to.
Returns
A newly re-sized Blob is returned.

Definition at line 2852 of file Blob.cs.

◆ Save()

void MyCaffe.common.Blob< T >.Save ( BinaryWriter  bw,
bool  bData,
bool  bDiff,
bool  bIncludeName = true 
)

Saves this Blob to a binary stream.

Parameters
bwSpecifies the binary writer.
bDataSpecifies whether or not to save the data.
bDiffSpecifies whether or not to save the diff.
bIncludeNameSpecifies whether or not to include the name.

Definition at line 2298 of file Blob.cs.

◆ SaveBinary()

void MyCaffe.common.Blob< T >.SaveBinary ( string  strFile,
bool  bData,
bool  bDiff,
bool  bIncludeName = true 
)

Saves the blob to a binary file.

Parameters
strFileSpecifies the file to save the data/diff into.
bDataSpecifies to save the data.
bDiffSpecifies to save the diff.
bIncludeNameSpecifies whether or not to include the name.

Definition at line 2282 of file Blob.cs.

◆ SaveToImage()

void MyCaffe.common.Blob< T >.SaveToImage ( string  strFile,
bool  bNonZeroExistOnly = true,
bool  bSaveDiff = false,
Dictionary< float, Color >  rgSpecialValues = null 
)

Save the Blob to an image where values less than 0 are colored red, and values greater than 0 are colored green. Values = 0 are colored black.

Parameters
strFileSpecifies the file where the image is saved.
bNonZeroExistOnlyOptionally, specifies to color whether data exists as nonZero only (default = true).
bSaveDiffOptionally, specifies to save the diff instead of the data (default = false).
rgSpecialValuesOptionally, specifies special values with associated colors.

Definition at line 3105 of file Blob.cs.

◆ SaveToNumpy() [1/4]

void MyCaffe.common.Blob< T >.SaveToNumpy ( string  strFile,
bool  bSaveDiff = false 
)

Save a blob with data to a Numpy .npy file.

Parameters
strFileSpecifies the .npy file name where the data is saved.
bSaveDiffSpecifies to save the diff, when false, the data is saved.
See also
A Simple File Format for NumPy Arrays

Definition at line 3259 of file Blob.cs.

◆ SaveToNumpy() [2/4]

static void MyCaffe.common.Blob< T >.SaveToNumpy ( string  strFile,
float[]  rgData,
int[]  rgShape 
)
static

Save a blob with data to a Numpy .npy file.

Parameters
strFileSpecifies the .npy file name where the data is saved.
rgDataSpecifies the data to be saved.
rgShapeSpecifies the shape of the data to be saved.
See also
A Simple File Format for NumPy Arrays

Definition at line 3316 of file Blob.cs.

◆ SaveToNumpy() [3/4]

static void MyCaffe.common.Blob< T >.SaveToNumpy ( string  strFile,
int[]  rgData,
int[]  rgShape 
)
static

Save a blob with data to a Numpy .npy file.

Parameters
strFileSpecifies the .npy file name where the data is saved.
rgDataSpecifies the data to be saved.
rgShapeSpecifies the shape of the data to be saved.
See also
A Simple File Format for NumPy Arrays

Definition at line 3367 of file Blob.cs.

◆ SaveToNumpy() [4/4]

static void MyCaffe.common.Blob< T >.SaveToNumpy ( string  strFile,
long[]  rgData,
int[]  rgShape 
)
static

Save a blob with data to a Numpy .npy file.

Parameters
strFileSpecifies the .npy file name where the data is saved.
rgDataSpecifies the data to be saved.
rgShapeSpecifies the shape of the data to be saved.
See also
A Simple File Format for NumPy Arrays

Definition at line 3418 of file Blob.cs.

◆ scale_data() [1/2]

void MyCaffe.common.Blob< T >.scale_data ( double  df)

Scale the data by a scaling factor.

Parameters
dfSpecifies the scaling factor.

Definition at line 1754 of file Blob.cs.

◆ scale_data() [2/2]

void MyCaffe.common.Blob< T >.scale_data ( fScaleFactor)

Scale the blob data by a constant factor.

Parameters
fScaleFactorSpecifies the scaling factor.

Definition at line 1782 of file Blob.cs.

◆ scale_diff() [1/2]

void MyCaffe.common.Blob< T >.scale_diff ( double  df)

Scale the diff by a scaling factor.

Parameters
dfSpecifies the scaling factor.

Definition at line 1763 of file Blob.cs.

◆ scale_diff() [2/2]

void MyCaffe.common.Blob< T >.scale_diff ( fScaleFactor)

Scale the blob diff by a constant factor.

Parameters
fScaleFactorSpecifies the scaling factor.

Definition at line 1791 of file Blob.cs.

◆ scale_to_range()

void MyCaffe.common.Blob< T >.scale_to_range ( double  dfMin,
double  dfMax 
)

Scale the data in the blob to the range [dfMin,dfMax].

Parameters
dfMinSpecifies the minimum of the range.
dfMaxSpecifies the maximum of the range.

Definition at line 1773 of file Blob.cs.

◆ SetCPUData()

void MyCaffe.common.Blob< T >.SetCPUData ( T[]  rg)

Sets just the CPU data to the data specified.

Parameters
rgSpecifies the CPU data to set.

Definition at line 2052 of file Blob.cs.

◆ SetData() [1/5]

void MyCaffe.common.Blob< T >.SetData ( double  dfVal,
int  nIdx = -1 
)

Either sets all of the data items in the Blob to a given value, or alternatively only sets a single indexed item to a given value.

Parameters
dfValSpecifies the value to set.
nIdxOptionally, specifies the index of the item to set.

Definition at line 1947 of file Blob.cs.

◆ SetData() [2/5]

void MyCaffe.common.Blob< T >.SetData ( double  dfVal,
int  nStartIdx,
int  nCount 
)

Set a data range with a given value.

Parameters
dfValSpecifies the value to set.
nStartIdxSpecifies the start index.
nCountSpecifies the number of items to set.

Definition at line 1961 of file Blob.cs.

◆ SetData() [3/5]

void MyCaffe.common.Blob< T >.SetData ( SimpleDatum  d,
bool  bReshape,
bool  bCopyData = true 
)

Sets the Blob values to the data contained within a SimpleDatum.

Parameters
dSpecifies the SimpleDatum.
bReshapeSpecifies whether or not to reshape the Blob to match the SimpleDatum.
bCopyDataOptionally, specifies whether or not to transfer the data.

Definition at line 2029 of file Blob.cs.

◆ SetData() [4/5]

void MyCaffe.common.Blob< T >.SetData ( fVal,
int  nIdx = -1 
)

Either sets all of the data items in the Blob to a given value, or alternatively only sets a single indexed item to a given value.

Parameters
fValSpecifies the value to set.
nIdxOptionally, specifies the index of the item to set.

Definition at line 1933 of file Blob.cs.

◆ SetData() [5/5]

void MyCaffe.common.Blob< T >.SetData ( T[]  rgData,
int  nCount = -1,
bool  bSetCount = true 
)

Sets a number of items within the Blob's data.

Parameters
rgDataSpecifies the data to set.
nCountOptionally, specifies a subset count of items to set.
bSetCountOptionally, specifies whether or not to set the count. The count is always set when re-allocating the buffer.

Definition at line 1922 of file Blob.cs.

◆ SetDiff() [1/3]

void MyCaffe.common.Blob< T >.SetDiff ( double  dfVal,
int  nIdx = -1 
)

Either sets all of the diff items in the Blob to a given value, or alternatively only sets a single indexed item to a given value.

Parameters
dfValSpecifies the value to set.
nIdxOptionally, specifies the index of the item to set.

Definition at line 1981 of file Blob.cs.

◆ SetDiff() [2/3]

void MyCaffe.common.Blob< T >.SetDiff ( double  dfVal,
int  nStartIdx,
int  nCount 
)

Set a diff range with a given value.

Parameters
dfValSpecifies the value to set.
nStartIdxSpecifies the start index.
nCountSpecifies the number of items to set.

Definition at line 1998 of file Blob.cs.

◆ SetDiff() [3/3]

void MyCaffe.common.Blob< T >.SetDiff ( T[]  rgDiff,
int  nCount = -1,
bool  bSetCount = true 
)

Sets a number of items within the Blob's diff.

Parameters
rgDiffSpecifies the diff to set.
nCountOptionally, specifies a subset count of items to set.
bSetCountOptionally, specifies whether or not to set the count. The count is always set when re-allocating the buffer.

Definition at line 2018 of file Blob.cs.

◆ SetParameter()

void MyCaffe.common.Blob< T >.SetParameter ( string  strName,
double  dfVal 
)

Set a blob parameter.

Parameters
strNameSpecifies the name of the blob parameter.
dfValSpecifies the value of the blob parameter.

Definition at line 233 of file Blob.cs.

◆ SetPixel() [1/2]

Tuple< T, T, T > MyCaffe.common.Blob< T >.SetPixel ( int  nX,
int  nY,
byte  R,
byte  G,
byte  B,
TransformationParameter.COLOR_ORDER  order = TransformationParameter.COLOR_ORDER.RGB 
)

Set the values of a 3 channel image embedded within the blob in the order RGB or BGR where the full hxw is stored for each color in order.

Parameters
nXSpecifies the x pixel within the image.
nYSpecifies the y pxiel within the image.
RSpecifies the color for the Red color channel.
GSpecifies the color for the Green color channel.
BSpecifies the color for the Blue color channel.
orderOptionally, specifies the color ordering RGB or BGR (default = RGB).
Returns
The original pixel is returned as a three item tuple.

Definition at line 3035 of file Blob.cs.

◆ SetPixel() [2/2]

Tuple< T, T, T > MyCaffe.common.Blob< T >.SetPixel ( int  nX,
int  nY,
Tuple< T, T, T >  pixel,
bool  bReturnOriginal = false,
TransformationParameter.COLOR_ORDER  order = TransformationParameter.COLOR_ORDER.RGB,
int  nOffset = 0 
)

Sets a pixel to the values within a three item tuple where the first item is assigned RED, second GREEN and third BLUE.

Parameters
nXSpecifies the x pixel within the image.
nYSpecifies the y pxiel within the image.
pixelSpecifies the color values for RED, GREEN and BLUE.
bReturnOriginalOptionally, specifies to return the original pixel.
orderOptionally, specifies the color ordering RGB or BGR (default = RGB).
nOffsetOptionally, specifies the offset to start at (default = 0).
Returns
The original pixel is returned as a three item tuple.

Definition at line 3068 of file Blob.cs.

◆ shape() [1/2]

List< int > MyCaffe.common.Blob< T >.shape ( )

Returns an array where each element contains the shape of an axis of the Blob.

Returns
The shape array is returned.

Definition at line 684 of file Blob.cs.

◆ shape() [2/2]

int MyCaffe.common.Blob< T >.shape ( int  nIdx)

Returns the dimension of the nIdx'th axis (or the negative nIdx'th axis from teh end, if nIdx is negative.

Parameters
nIdxThe axis index, which may be negative as it will be 'canonicalized' using CanonicalAxisIndex.
Returns

Definition at line 696 of file Blob.cs.

◆ ShapeEquals()

bool MyCaffe.common.Blob< T >.ShapeEquals ( BlobProto  bp)

Compares the shape of this blob to the shape within a BlobProto.

Parameters
bpSpecifies the BlobProto to compare.
Returns
If the shapes are the same this method returns true, otherwise false.

Definition at line 2079 of file Blob.cs.

◆ Share()

void MyCaffe.common.Blob< T >.Share ( Blob< T >  b)

Share another Blob with this one, by setting the data and diff to the same data and diff of the other Blob.

Parameters
bSpecifies the other Blob to share.

Definition at line 1850 of file Blob.cs.

◆ ShareData()

void MyCaffe.common.Blob< T >.ShareData ( Blob< T >  b)

Set the data to point to the data of the other blob – useful in Layers which simply perform a copy in their forward pass.

Parameters
b

Definition at line 1813 of file Blob.cs.

◆ ShareDiff()

void MyCaffe.common.Blob< T >.ShareDiff ( Blob< T >  b)

Set the diff to point to the diff of the other blob – useful in Layers which simply perform a copy in their forward pass.

Parameters
b

Definition at line 1832 of file Blob.cs.

◆ std()

double MyCaffe.common.Blob< T >.std ( double?  dfMean = null,
float[]  rgDf = null 
)

Calculate the standard deviation of the blob data.

Parameters
dfMeanOptionally, specifies the mean to use (default = null).
rgDfOptionally, specifies the CPU data to calculate the std on (default = null).
Returns
The standard deviation of the bob data is returned.

Definition at line 3007 of file Blob.cs.

◆ sum()

double MyCaffe.common.Blob< T >.sum ( float[]  rgDf = null,
bool  bDiff = false 
)

Calculate the sum of the blob data.

Parameters
rgDfOptionally, specifies the CPU data to use (default = null).
bDiffOptionally, specifies to use the diff instead of the data.
Returns
The mean is returned.

Definition at line 2986 of file Blob.cs.

◆ sumsq_data()

T MyCaffe.common.Blob< T >.sumsq_data ( )

Calcualte the sum of squares (L2 norm squared) of the data.

Returns

Definition at line 1730 of file Blob.cs.

◆ sumsq_diff()

T MyCaffe.common.Blob< T >.sumsq_diff ( )

Calcualte the sum of squares (L2 norm squared) of the diff.

Returns

Definition at line 1742 of file Blob.cs.

◆ ToByteArray()

byte[] MyCaffe.common.Blob< T >.ToByteArray ( )

Saves this Blob to a byte array.

Returns
The byte array containing all data of the blob is returned.

Definition at line 2436 of file Blob.cs.

◆ ToDatum()

Datum MyCaffe.common.Blob< T >.ToDatum ( )

Returns a new Datum that contains the shape and data of the Blob.

Returns
A Datum is returned.

Definition at line 2166 of file Blob.cs.

◆ ToProto()

BlobProto MyCaffe.common.Blob< T >.ToProto ( bool  bWriteDiff = false)

Writes the Blob to a new BlobProto.

Parameters
bWriteDiffWhen true, the diff is written to the BlobProto, otherwise the data is written.
Returns
The new BlobProto is returned.

Definition at line 1663 of file Blob.cs.

◆ ToSizeString()

string MyCaffe.common.Blob< T >.ToSizeString ( )

Returns a string describing the 4D shape of the Blob.

Returns
A shape string is returned.

Definition at line 2157 of file Blob.cs.

◆ ToString() [1/2]

override string MyCaffe.common.Blob< T >.ToString ( )

Returns a string representation of the Blob.

Returns

Definition at line 2466 of file Blob.cs.

◆ ToString() [2/2]

string MyCaffe.common.Blob< T >.ToString ( int  nMax,
bool  bDiff = false 
)

Get the string representation containing up to the first 'nMax' items.

Parameters
nMaxSpecifies the maximum number of data items to return.
bDiffSpecifies to returive the diff when true.
Returns
The string representation is returned.

Definition at line 2478 of file Blob.cs.

◆ Unsqueeze()

void MyCaffe.common.Blob< T >.Unsqueeze ( int  nNumAxes)

Unsqueeze the shape by adding shape=1 on each axis until the 'nNumAxes' is reached.

Parameters
nNumAxesSpecifies the number of axes to unsqueeze to.

Definition at line 201 of file Blob.cs.

◆ Update()

void MyCaffe.common.Blob< T >.Update ( )

The 'update' method is used for parameter blobs in a Net.

Update is called to apply the diff errors to the data. When !bIncludeDiff or freeze_learning = true, no diff is applied.

Definition at line 1575 of file Blob.cs.

◆ update_cpu_data()

T[] MyCaffe.common.Blob< T >.update_cpu_data ( )

Update the CPU data by transferring the GPU data over to the Host.

Returns
The Host data is returned.

Definition at line 1470 of file Blob.cs.

◆ update_cpu_diff()

T[] MyCaffe.common.Blob< T >.update_cpu_diff ( )

Update the CPU diff by transferring the GPU diff over to the Host.

Returns
The Host diff is returned.

Definition at line 1529 of file Blob.cs.

◆ ValidateData()

bool MyCaffe.common.Blob< T >.ValidateData ( Blob< T >  work,
bool  bDiff = false 
)

Validate the data or diff looking for NAN or Inf.

Parameters
workSpecifies the work blob.
bDiffSpecifies to validate the diff (true) or the data (false).
Returns
True is returned if the data (or diff) contains no NAN or Inf.

Definition at line 1197 of file Blob.cs.

Member Data Documentation

◆ MAX_BLOB_AXES

const int MyCaffe.common.Blob< T >.MAX_BLOB_AXES = 32
static

Defines the maximum number of Axes supported by the Blob.

Definition at line 55 of file Blob.cs.

Property Documentation

◆ channels

int MyCaffe.common.Blob< T >.channels
get

DEPRECIATED; legacy shape accessor channels: use shape(1) instead.

Definition at line 799 of file Blob.cs.

◆ cpu_data

T [] MyCaffe.common.Blob< T >.cpu_data
get

Returns the last host data retrieved from the GPU.

Definition at line 1451 of file Blob.cs.

◆ cpu_diff

T [] MyCaffe.common.Blob< T >.cpu_diff
get

Returns the last host diff retrieved from the GPU.

Definition at line 1495 of file Blob.cs.

◆ Cuda

CudaDnn<T> MyCaffe.common.Blob< T >.Cuda
get

Returns the CudaDnn object that manages the Blob's memory."/>

Definition at line 385 of file Blob.cs.

◆ data

Returns the SyncedMemory that stores the data.

Definition at line 1435 of file Blob.cs.

◆ diff

Returns the SyncedMemory that stores the diff.

Definition at line 1443 of file Blob.cs.

◆ DiffExists

bool MyCaffe.common.Blob< T >.DiffExists
get

Returns whether or not the Diff portion exists.

Definition at line 675 of file Blob.cs.

◆ freeze_learning

bool MyCaffe.common.Blob< T >.freeze_learning
getset

Specifies whether or not the diff is applied to the data during Update. When freeze learning = true, the update is skipped.

Definition at line 376 of file Blob.cs.

◆ gpu_data

long MyCaffe.common.Blob< T >.gpu_data
get

Returns the data GPU handle used by the CudaDnn connection.

Definition at line 1478 of file Blob.cs.

◆ gpu_diff

long MyCaffe.common.Blob< T >.gpu_diff
get

Returns the diff GPU handle used by the CudaDnn connection.

Definition at line 1540 of file Blob.cs.

◆ gpu_shape

long MyCaffe.common.Blob< T >.gpu_shape
get

Returns the shape GPU handle used by the CudaDnn connection. The shape data contains the shape information of the Blob for use in GPU operations.

Definition at line 1564 of file Blob.cs.

◆ HalfSize

bool MyCaffe.common.Blob< T >.HalfSize
get

Returns whether or not this blob is using half sizes.

Definition at line 368 of file Blob.cs.

◆ height

int MyCaffe.common.Blob< T >.height
get

DEPRECIATED; legacy shape accessor height: use shape(2) instead.

Definition at line 807 of file Blob.cs.

◆ Log

Returns the Log associated with the blob.

Definition at line 393 of file Blob.cs.

◆ max_data

double MyCaffe.common.Blob< T >.max_data
get

Returns the maximum value in the data of the Blob.

Definition at line 2524 of file Blob.cs.

◆ max_diff

double MyCaffe.common.Blob< T >.max_diff
get

Returns the maximum value in the diff of the Blob.

Definition at line 2576 of file Blob.cs.

◆ min_data

double MyCaffe.common.Blob< T >.min_data
get

Returns the minimum value in the data of the Blob.

Definition at line 2498 of file Blob.cs.

◆ min_diff

double MyCaffe.common.Blob< T >.min_diff
get

Returns the minimum value in the diff of the Blob.

Definition at line 2550 of file Blob.cs.

◆ MinusOne

T MyCaffe.common.Blob< T >.MinusOne
staticget

Returns MinusOne (-1) in type T.

Definition at line 275 of file Blob.cs.

◆ mutable_cpu_data

T [] MyCaffe.common.Blob< T >.mutable_cpu_data
getset

Get data from the GPU and bring it over to the host, or Set data from the Host and send it over to the GPU.

Definition at line 1460 of file Blob.cs.

◆ mutable_cpu_diff

T [] MyCaffe.common.Blob< T >.mutable_cpu_diff
getset

Get diff from the GPU and bring it over to the host, or Set diff from the Host and send it over to the GPU.

Definition at line 1510 of file Blob.cs.

◆ mutable_gpu_data

long MyCaffe.common.Blob< T >.mutable_gpu_data
get

Returns the data GPU handle used by the CudaDnn connection.

Definition at line 1486 of file Blob.cs.

◆ mutable_gpu_diff

long MyCaffe.common.Blob< T >.mutable_gpu_diff
get

Returns the diff GPU handle used by the CudaDnn connection.

Definition at line 1554 of file Blob.cs.

◆ Name

string MyCaffe.common.Blob< T >.Name
getset

Get/set the name of the Blob.

Definition at line 2183 of file Blob.cs.

◆ num

int MyCaffe.common.Blob< T >.num
get

DEPRECIATED; legacy shape accessor num: use shape(0) instead.

Definition at line 791 of file Blob.cs.

◆ num_axes

int MyCaffe.common.Blob< T >.num_axes
get

Returns the number of axes in the Blob.

Definition at line 704 of file Blob.cs.

◆ num_true_axes

int MyCaffe.common.Blob< T >.num_true_axes
get

Returns the number of true axes, ignoring the trailing ones.

Definition at line 715 of file Blob.cs.

◆ One

T MyCaffe.common.Blob< T >.One
staticget

Returns One (1) in type T.

Definition at line 267 of file Blob.cs.

◆ Padded

bool MyCaffe.common.Blob< T >.Padded
getset

Get/set the padding state of the blob.

Definition at line 283 of file Blob.cs.

◆ reshape_when_sharing

bool MyCaffe.common.Blob< T >.reshape_when_sharing
getset

When true, this Blob is reshaped to the source when sharing the source data (default = false).

This setting is used by the Net when sharing trained weights.

Definition at line 1802 of file Blob.cs.

◆ shape_string

string MyCaffe.common.Blob< T >.shape_string
get

Returns a string describing the Blob's shape.

Definition at line 656 of file Blob.cs.

◆ snapshot_requested

bool MyCaffe.common.Blob< T >.snapshot_requested
getset

Get/set the snapshot request.

This setting is used by learnable parameters that have requested a snapshot.

Definition at line 1882 of file Blob.cs.

◆ Tag

object MyCaffe.common.Blob< T >.Tag
getset

Returns a user defined object associated with the Blob.

Definition at line 2769 of file Blob.cs.

◆ type

BLOB_TYPE MyCaffe.common.Blob< T >.type
getset

Returns the BLOB_TYPE of the Blob.

Definition at line 2760 of file Blob.cs.

◆ width

int MyCaffe.common.Blob< T >.width
get

DEPRECIATED; legacy shape accessor width: use shape(3) instead.

Definition at line 815 of file Blob.cs.

◆ Zero

T MyCaffe.common.Blob< T >.Zero
staticget

Returns Zero (0) in type T.

Definition at line 259 of file Blob.cs.


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