MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The IXPersist interface is used by the CaffeControl to load and save weights. More...
Public Member Functions | |
byte[] | SaveWeights (BlobCollection< T > colBlobs, bool bSaveDiffs=false) |
Save the weights to a byte array. More... | |
BlobCollection< T > | LoadWeights (byte[] rgWeights, List< string > rgExpectedShapes, BlobCollection< T > colBlobs, bool bSizeToFit, out bool bLoadedDiffs, List< string > inputWtInfo=null, List< string > targetWtInfo=null, string strSkipBlobType=null) |
Loads new weights into a BlobCollection More... | |
byte[] | SaveSolverState (SolverState state, SolverParameter.SolverType type=SolverParameter.SolverType.SGD) |
Save the solver state to a byte array. More... | |
SolverState | LoadSolverState (byte[] rgState, SolverParameter.SolverType type=SolverParameter.SolverType.SGD) |
Load the solver state from a byte array. More... | |
WeightInfo< T > | LoadWeightInfo (byte[] rgWeights) |
Returns the weight information describing the weights containined within the weight bytes. More... | |
WeightInfo< T > | LoadWeightInfo (BlobCollection< T > colBlobs) |
Returns the weight information describing the weights containined within the Blob collection. More... | |
The IXPersist interface is used by the CaffeControl to load and save weights.
T | Specifies the base type float or double. Using float is recommended to conserve GPU memory. |
Definition at line 186 of file Interfaces.cs.
SolverState MyCaffe.common.IXPersist< T >.LoadSolverState | ( | byte[] | rgState, |
SolverParameter.SolverType | type = SolverParameter.SolverType.SGD |
||
) |
Load the solver state from a byte array.
rgState | Specifies the byte array containing the solver state. |
type | Specifies the solver type. |
Implemented in MyCaffe.common.PersistCaffe< T >.
WeightInfo< T > MyCaffe.common.IXPersist< T >.LoadWeightInfo | ( | BlobCollection< T > | colBlobs | ) |
Returns the weight information describing the weights containined within the Blob collection.
colBlobs | Specifies the Blob collection containing the weights. |
Implemented in MyCaffe.common.PersistCaffe< T >.
WeightInfo< T > MyCaffe.common.IXPersist< T >.LoadWeightInfo | ( | byte[] | rgWeights | ) |
Returns the weight information describing the weights containined within the weight bytes.
rgWeights | Specifies the bytes containing the weights. |
Implemented in MyCaffe.common.PersistCaffe< T >.
BlobCollection< T > MyCaffe.common.IXPersist< T >.LoadWeights | ( | byte[] | rgWeights, |
List< string > | rgExpectedShapes, | ||
BlobCollection< T > | colBlobs, | ||
bool | bSizeToFit, | ||
out bool | bLoadedDiffs, | ||
List< string > | inputWtInfo = null , |
||
List< string > | targetWtInfo = null , |
||
string | strSkipBlobType = null |
||
) |
Loads new weights into a BlobCollection
NOTE: In order to maintain compatibility with the C++ Caffe, extra MyCaffe features may be added to the end of the weight file. After saving weights (see SaveWeights) in the format used by the C++ Caffe, MyCaffe writes the bytes "mycaffe.ai". All information after these bytes are specific to MyCaffe and allow for loading weights for models by Blob name and shape and loosen the C++ Caffe requirement that the 'number' of blobs match. Adding this functionality allows for training model, changing the model structure, and then re-using the trained weights in the new model.
rgWeights | Specifies the weights themselves. |
rgExpectedShapes | Specifies a list of expected shapes for each Blob where the weights are to be loaded. |
colBlobs | Specifies the Blobs to load with the weights. |
bSizeToFit | Optionally, specifies wether or not the weights should be re-sized. Note: resizing can render the weights useless, especially in deeper, layers. |
bLoadedDiffs | Returns whether or not the diffs were loaded. |
inputWtInfo | Optionally, specifies the weight info describing the input weight blobs to import by name. Note when used the number of blobs must match the number of targetWtInfo blobs. Otherwise, when null this parameter is ignored. |
targetWtInfo | Optionally, specifies the weight info describing the target weight blobs to import by name. Note when used the number of blobs must match the number of inputWtInfo blobs. Otherwise, when null this parameter is ignored. |
strSkipBlobType | Optionally, specifies a blob type where weights are NOT loaded. See Blob.BLOB_TYPE for the types of Blobs. |
Implemented in MyCaffe.common.PersistCaffe< T >.
byte[] MyCaffe.common.IXPersist< T >.SaveSolverState | ( | SolverState | state, |
SolverParameter.SolverType | type = SolverParameter.SolverType.SGD |
||
) |
Save the solver state to a byte array.
state | Specifies the solver state to save. |
type | Specifies the solver type. |
Implemented in MyCaffe.common.PersistCaffe< T >.
byte[] MyCaffe.common.IXPersist< T >.SaveWeights | ( | BlobCollection< T > | colBlobs, |
bool | bSaveDiffs = false |
||
) |
Save the weights to a byte array.
NOTE: In order to maintain compatibility with the C++ Caffe, extra MyCaffe features may be added to the end of the weight file. After saving weights in the format used by the C++ Caffe, MyCaffe writes the bytes "mycaffe.ai". All information after these bytes are specific to MyCaffe and allow for loading weights for models by Blob name and shape and loosen the C++ Caffe requirement that the 'number' of blobs match. Adding this functionality allows for training model, changing the model structure, and then re-using the trained weights in the new model.
colBlobs | Specifies the Blobs to save with the weights. |
bSaveDiffs | Optionally, specifies to save the diff values. |
Implemented in MyCaffe.common.PersistCaffe< T >.