MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The BlobCollection contains a list of Blobs. More...
Public Member Functions | |
BlobCollection () | |
The BlobCollection constructor. More... | |
Blob< T > | FindBlob (string strName) |
Finds a given blob in the collection based on its name. More... | |
void | Insert (int nIdx, Blob< T > b) |
Insert a blob at the given index. More... | |
void | Add (Blob< T > b) |
Add a new Blob to the collection. More... | |
void | Add (BlobCollection< T > rg) |
Add another BlobCollection to this one. More... | |
bool | Remove (Blob< T > b) |
If it exists, remove a Blob from the collection. More... | |
void | RemoveAt (int nIdx) |
Remove a Blob at a given index in the collection. More... | |
void | Clear (bool bDispose=false) |
Remove all items from the collection. More... | |
bool | Contains (Blob< T > blob) |
Returns whether or not the collection contains a given blob. More... | |
BlobCollection< T > | FindRelatedBlobs (Blob< T > b) |
Find all Blobs in the collection that contain (in part or in whole) the name of a given Blob. More... | |
IEnumerator< Blob< T > > | GetEnumerator () |
Get the enumerator for the collection. More... | |
BlobCollection< T > | Clone () |
Copy the collection and return it as a new collection. More... | |
void | ReshapeLike (BlobCollection< T > src) |
Reshapes all blobs in the collection to the sizes of the source. More... | |
void | ReshapeLike (Blob< T > blob) |
Reshapes all blobs in the collection to the sizes of the source. More... | |
void | Reshape (int[] rgShape) |
Reshapes all blobs in the collection to the given shape. More... | |
void | Reshape (int nN, int nC, int nH, int nW) |
Reshapes all blobs in the collection to the given shape. More... | |
void | CopyFrom (BlobCollection< T > bSrc, bool bCopyDiff=false) |
Copy the data or diff from another BlobCollection into this one. More... | |
void | Accumulate (CudaDnn< T > cuda, BlobCollection< T > src, bool bAccumulateDiff) |
Accumulate the diffs from one BlobCollection into another. More... | |
void | SetDiff (double df) |
Set all blob diff to the value specified. More... | |
void | SetData (double df) |
Set all blob data to the value specified. More... | |
BlobCollection< T > | MathSub (BlobCollection< T > col, bool bSkipFirstItem) |
Create a new collection of cloned Blobs created by calling MathSub to subtract the Blobs in this collection from another collection. More... | |
BlobCollection< T > | MathAdd (BlobCollection< T > colA, double dfScale, bool bSkipFirstItem) |
Create a new collection of cloned Blobs created by calling MathAdd to add the Blobs in this collection to another collection. More... | |
BlobCollection< T > | MathDiv (double dfVal, bool bSkipFirstItem) |
Create a new collection of cloned Blobs created by calling MathDif to divide the Blobs in this collection with a scalar. More... | |
void | Save (BinaryWriter bw, bool bData, bool bDiff) |
Save the collection to a binary writer. More... | |
bool | Share (Blob< T > b, List< int > rgMinShape, bool bThrowExceptions, bool bAllowEndsWith=false) |
Share the first Blob found with the same name as the given Blob. More... | |
bool | SnapshotRequested (bool bReset) |
Returns whether or not any blobs have a snapshot request set to true. More... | |
Dictionary< string, Tuple< double, double, double, double > > | CollectMinMax (Blob< T > blobWork, bool bDiff=false) |
Collect all min/max, inf and nan values from all Blobs in the collection. More... | |
void | Dispose () |
Release all resource used by the collection and its Blobs. More... | |
Static Public Member Functions | |
static BlobCollection< T > | Load (CudaDnn< T > cuda, Log log, BinaryReader br, bool bData, bool bDiff) |
Loads a new collection from a binary reader. More... | |
Properties | |
int | Count [get] |
Returns the number of items in the collection. More... | |
Blob< T > | this[int nIdx] [getset] |
Get/set an item within the collection at a given index. More... | |
Blob< T > | this[string strName] [get] |
Get the item with the specified name, or throw an exception if not found. More... | |
The BlobCollection contains a list of Blobs.
T | Specifies the base type float or double. Using float is recommended to conserve GPU memory. |
Definition at line 15 of file BlobCollection.cs.
The BlobCollection constructor.
Definition at line 22 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Accumulate | ( | CudaDnn< T > | cuda, |
BlobCollection< T > | src, | ||
bool | bAccumulateDiff | ||
) |
Accumulate the diffs from one BlobCollection into another.
cuda | Specifies the CudaDnn instance used to add the blobs into this collection. |
src | Specifies the source BlobCollection to add into this one. |
bAccumulateDiff | Specifies to accumulate diffs when true, and the data otherwise. |
Definition at line 283 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Add | ( | Blob< T > | b | ) |
Add a new Blob to the collection.
b | Specifies the Blob to add. |
Definition at line 92 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Add | ( | BlobCollection< T > | rg | ) |
Add another BlobCollection to this one.
rg | Specifies the blob collection to add. |
Definition at line 101 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Clear | ( | bool | bDispose = false | ) |
Remove all items from the collection.
bDispose | Optionally, call Dispose on each item removed. |
Definition at line 135 of file BlobCollection.cs.
BlobCollection< T > MyCaffe.common.BlobCollection< T >.Clone | ( | ) |
Copy the collection and return it as a new collection.
Definition at line 198 of file BlobCollection.cs.
Dictionary< string, Tuple< double, double, double, double > > MyCaffe.common.BlobCollection< T >.CollectMinMax | ( | Blob< T > | blobWork, |
bool | bDiff = false |
||
) |
Collect all min/max, inf and nan values from all Blobs in the collection.
blobWork | Specifies a work blob. |
bDiff | Specifies to collect the values on the diff (true) vs. the data (false). |
Definition at line 513 of file BlobCollection.cs.
bool MyCaffe.common.BlobCollection< T >.Contains | ( | Blob< T > | blob | ) |
Returns whether or not the collection contains a given blob.
blob | Specifies the blob to look for. |
Definition at line 153 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.CopyFrom | ( | BlobCollection< T > | bSrc, |
bool | bCopyDiff = false |
||
) |
Copy the data or diff from another BlobCollection into this one.
bSrc | Specifies the src BlobCollection to copy. |
bCopyDiff | Optionally, specifies to copy the diff instead of the data (default = false). |
Definition at line 266 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Dispose | ( | ) |
Release all resource used by the collection and its Blobs.
Definition at line 542 of file BlobCollection.cs.
Blob< T > MyCaffe.common.BlobCollection< T >.FindBlob | ( | string | strName | ) |
Finds a given blob in the collection based on its name.
strName | Specifies the name of the blob to find. |
Definition at line 67 of file BlobCollection.cs.
BlobCollection< T > MyCaffe.common.BlobCollection< T >.FindRelatedBlobs | ( | Blob< T > | b | ) |
Find all Blobs in the collection that contain (in part or in whole) the name of a given Blob.
b | Specifies the Blob to look for. |
Definition at line 163 of file BlobCollection.cs.
IEnumerator< Blob< T > > MyCaffe.common.BlobCollection< T >.GetEnumerator | ( | ) |
Get the enumerator for the collection.
Definition at line 180 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Insert | ( | int | nIdx, |
Blob< T > | b | ||
) |
Insert a blob at the given index.
nIdx | Specifies the index where the blob should be added. |
b | Specifies the blob to add. |
Definition at line 83 of file BlobCollection.cs.
|
static |
Loads a new collection from a binary reader.
cuda | Specifies the instance of CudaDnn to use for the Cuda connection. |
log | Specifies the Log to use for output. |
br | Specifies the binary reader. |
bData | Specifies whether or not to read the data. |
bDiff | Specifies whether or not to read the diff. |
Definition at line 428 of file BlobCollection.cs.
BlobCollection< T > MyCaffe.common.BlobCollection< T >.MathAdd | ( | BlobCollection< T > | colA, |
double | dfScale, | ||
bool | bSkipFirstItem | ||
) |
Create a new collection of cloned Blobs created by calling MathAdd to add the Blobs in this collection to another collection.
Calculation: Y = Clone(colA) * dfScale + this
colA | Specifies the collection that will be cloned. |
dfScale | Specifies the scale that will be applied to the clone of this collection |
bSkipFirstItem | Specifies whether or not to skip the first item. |
Definition at line 366 of file BlobCollection.cs.
BlobCollection< T > MyCaffe.common.BlobCollection< T >.MathDiv | ( | double | dfVal, |
bool | bSkipFirstItem | ||
) |
Create a new collection of cloned Blobs created by calling MathDif to divide the Blobs in this collection with a scalar.
dfVal | Specifies the divisor. |
bSkipFirstItem | Specifies whether or not to skip the first item. |
Definition at line 389 of file BlobCollection.cs.
BlobCollection< T > MyCaffe.common.BlobCollection< T >.MathSub | ( | BlobCollection< T > | col, |
bool | bSkipFirstItem | ||
) |
Create a new collection of cloned Blobs created by calling MathSub to subtract the Blobs in this collection from another collection.
Calculation: Y = Clone(colA) - this
col | Specifies the collection that this collection will be subtracted from. |
bSkipFirstItem | Specifies whether or not to skip the first item. |
Definition at line 340 of file BlobCollection.cs.
bool MyCaffe.common.BlobCollection< T >.Remove | ( | Blob< T > | b | ) |
If it exists, remove a Blob from the collection.
b | Specifies the Blob. |
Definition at line 117 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.RemoveAt | ( | int | nIdx | ) |
Remove a Blob at a given index in the collection.
nIdx | Specifies the index. |
Definition at line 126 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Reshape | ( | int | nN, |
int | nC, | ||
int | nH, | ||
int | nW | ||
) |
Reshapes all blobs in the collection to the given shape.
nN | Specifies the number of items. |
nC | Specifies the number of channels. |
nH | Specifies the spatial height. |
nW | Specifies the spatial width. |
Definition at line 253 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Reshape | ( | int[] | rgShape | ) |
Reshapes all blobs in the collection to the given shape.
rgShape | Specifies the shape to use. |
Definition at line 238 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.ReshapeLike | ( | Blob< T > | blob | ) |
Reshapes all blobs in the collection to the sizes of the source.
blob | Specifies the source blob. |
Definition at line 226 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.ReshapeLike | ( | BlobCollection< T > | src | ) |
Reshapes all blobs in the collection to the sizes of the source.
src | Specifies the source collection to reshape to. |
Definition at line 214 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.Save | ( | BinaryWriter | bw, |
bool | bData, | ||
bool | bDiff | ||
) |
Save the collection to a binary writer.
bw | Specifies the binary writer. |
bData | Specifies whether or not to save the data. |
bDiff | Specifies whether or not to save the diff. |
Definition at line 409 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.SetData | ( | double | df | ) |
Set all blob data to the value specified.
df | Specifies the value to set all blob data to. |
Definition at line 323 of file BlobCollection.cs.
void MyCaffe.common.BlobCollection< T >.SetDiff | ( | double | df | ) |
Set all blob diff to the value specified.
df | Specifies the value to set all blob diff to. |
Definition at line 311 of file BlobCollection.cs.
bool MyCaffe.common.BlobCollection< T >.Share | ( | Blob< T > | b, |
List< int > | rgMinShape, | ||
bool | bThrowExceptions, | ||
bool | bAllowEndsWith = false |
||
) |
Share the first Blob found with the same name as the given Blob.
b | Specifies the Blob that will share the found Blob. |
rgMinShape | Specifies the minimum shape required to share. |
bThrowExceptions | Specifies whether or not th throw an Exception if the sizes do not match. |
bAllowEndsWith | Optionally, allow name comparison where the share blob name ends with the 'b' blob name (default = false). |
Definition at line 449 of file BlobCollection.cs.
bool MyCaffe.common.BlobCollection< T >.SnapshotRequested | ( | bool | bReset | ) |
Returns whether or not any blobs have a snapshot request set to true.
Definition at line 489 of file BlobCollection.cs.
|
get |
Returns the number of items in the collection.
Definition at line 29 of file BlobCollection.cs.
|
getset |
Get/set an item within the collection at a given index.
nIdx | Specifies the index of the item to access. |
Definition at line 39 of file BlobCollection.cs.
|
get |
Get the item with the specified name, or throw an exception if not found.
strName | Specifies the name of the blob to find. |
Definition at line 50 of file BlobCollection.cs.