6using System.Collections.Generic;
10using System.Runtime.Serialization;
13using System.Threading.Tasks;
220 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);
402 bool VerifyCompute(
string strExtra =
null,
int nDeviceID = -1,
bool bThrowException =
true);
448 bool Load(
Phase phase,
string strSolver,
string strModel,
byte[] rgWeights,
DB_LABEL_SELECTION_METHOD? labelSelectionOverride =
null,
DB_ITEM_SELECTION_METHOD? itemSelectionOverride =
null,
bool bResetFirst =
false,
IXDatabaseBase db =
null,
bool bUseDb =
true,
bool bCreateRunNet =
true,
string strStage =
null,
bool bEnableMemTrace =
false);
454 void Unload(
bool bUnloadDb =
true,
bool bIgnoreExceptions =
false);
463 void Train(
int nIterationOverride = -1,
int nTrainingTimeLimitInMinutes = 0,
TRAIN_STEP step =
TRAIN_STEP.NONE,
double dfLearningRateOverride = 0,
bool bReset =
false);
469 double Test(
int nIterationOverride = -1);
501 List<ResultCollection>
Run(List<int> rgImageIdx);
The CancelEvent provides an extension to the manual cancel event that allows for overriding the manua...
The ProjectEx class manages a project containing the solver description, model description,...
Specifies a key-value pair of properties.
The SimpleDatum class holds a data input within host memory.
The DatasetDescriptor class describes a dataset which contains both a training data source and testin...
The BlobCollection contains a list of Blobs.
The Blob is the main holder of data that moves through the Layers of the Net.
The ResultCollection contains the result of a given CaffeControl::Run.
The WeightInfo class describes the weights of a given weight set including the blob names and sizes o...
The WorkspaceArgs are passed to both the Layer::OnSetWorkspace and Layer::OnGetWorkspace events.
The Database class manages the actual connection to the physical database using Entity Framworks from...
Specifies the shape of a Blob.
The SolverParameter is a parameter for the solver, specifying the train and test networks.
SolverType
Defines the type of solver.
The SolverState specifies the state of a given solver.
The IXDatabaseBase interface defines the general interface to the in-memory database.
The IXDebugData interface is implemented by the DebugLayer to give access to the debug information ma...
long kernel_handle
Returns the handle to the kernel within the low-level Cuda Dnn DLL that where the data memory resides...
int load_count
Returns the number of data items loaded into the collection.
BlobCollection< T > data
Returns the collection of data blobs.
BlobCollection< T > labels
Returns the collection of label blobs.
string name
Returns the name of the data set.
The IXMyCaffeExtension interface allows for easy extension management of the low-level software that ...
void FreeExtension(long hExtension)
Free an existing extension and unload it.
T[] RunExtension(long hExtension, long lfnIdx, T[] rgParam)
Run a function on an existing extension.
long CreateExtension(string strExtensionDLLPath)
Create and load a new extension DLL.
float[] RunExtensionF(long hExtension, long lfnIdx, float[] rgParam)
Run a function on an existing extension using the float base type.
double[] RunExtensionD(long hExtension, long lfnIdx, double[] rgParam)
Run a function on an existing extension using the double base type.
The IXMyCaffe interface contains functions used to perform MyCaffe operations that work with the MyCa...
SimpleDatum GetItemMean()
Returns the image mean used by the solver network used during training.
void Unload(bool bUnloadDb=true, bool bIgnoreExceptions=false)
Unload the currently loaded project.
bool Load(Phase phase, string strSolver, string strModel, byte[] rgWeights, DB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, DB_ITEM_SELECTION_METHOD? itemSelectionOverride=null, bool bResetFirst=false, IXDatabaseBase db=null, bool bUseDb=true, bool bCreateRunNet=true, string strStage=null, bool bEnableMemTrace=false)
Load a project and optionally the MyCaffeImageDatabase.
ResultCollection Run(SimpleDatum d, bool bSort=true, bool bUseSolverNet=false)
Run on a given Datum.
void Train(int nIterationOverride=-1, int nTrainingTimeLimitInMinutes=0, TRAIN_STEP step=TRAIN_STEP.NONE, double dfLearningRateOverride=0, bool bReset=false)
Train the network a set number of iterations and allow for single stepping.
DatasetDescriptor GetDataset()
Returns the current dataset used when training and testing.
bool Load(Phase phase, ProjectEx p, DB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, DB_ITEM_SELECTION_METHOD? itemSelectionOverride=null, bool bResetFirst=false, IXDatabaseBase db=null, bool bUseDb=true, bool bCreateRunNet=true, string strStage=null, bool bEnableMemTrace=false)
Load a project and optionally the MyCaffeImageDatabase.
PropertySet TestMany(PropertySet customInput)
Runs test many on a set of custom input data.
List< Tuple< SimpleDatum, ResultCollection > > TestMany(int nCount, bool bOnTrainingSet, bool bOnTargetSet=false, DB_ITEM_SELECTION_METHOD imgSelMethod=DB_ITEM_SELECTION_METHOD.RANDOM, int nImageStartIdx=0, DateTime? dtImageStartTime=null, double? dfThreshold=null)
Test on a number of images by selecting random images from the database, running them through the Run...
Bitmap GetTestImage(Phase phase, out int nLabel, out string strLabel)
Retrieves a random image from either the training or test set depending on the Phase specified.
byte[] GetWeights()
Retrieves the weights of the training network.
Bitmap GetTestImage(Phase phase, int nLabel)
Retrieves a random image from either the training or test set depending on the Phase specified.
void UpdateWeights(byte[] rgWeights)
Loads the training Net with new weights.
double Test(int nIterationOverride=-1)
Test the network a given number of iterations.
ResultCollection Run(int nImageIdx, bool bPad=true)
Run on a given image in the MyCaffeImageDatabase based on its image index.
List< ResultCollection > Run(List< int > rgImageIdx)
Run on a set of images in the MyCaffeImageDatabase based on their image indexes.
string GetLicenseText(string strOtherLicenses)
Returns the license text for MyCaffe.
void UpdateRunWeights(bool bOutputStatus=false, bool bVerifyWeights=true)
Loads the weights from the training net into the Net used for running.
The IXMyCaffeNoDb interface contains functions used to perform MyCaffe operations that run in a light...
ResultCollection Run(SimpleDatum d, bool bSort=true, bool bPad=true)
Run on a given Datum.
void LoadToRun(string strModel, byte[] rgWeights, BlobShape shape, SimpleDatum sdMean=null, TransformationParameter transParam=null, bool bForceBackward=false, bool bConvertToRunNet=true)
The LoadToRun method loads the MyCaffeControl for running only (e.g. deployment).
Blob< T > CreateDataBlob(SimpleDatum d, Blob< T > blob=null, bool bPad=true)
Create a data blob from a SimpleDatum by transforming the data and placing the results in the blob re...
ResultCollection Run(Bitmap img, bool bSort=true, bool bPad=true)
Run on a given bitmap image.
The IXMyCaffeState interface contains functions related to the MyCaffeComponent state.
string LabelQueryEpochs
Returns a string describing the label query epochs observed during training.
IXPersist< T > Persist
Returns the persist used to load and save weights.
ProjectEx CurrentProject
Returns the name of the currently loaded project.
bool EnableBlobDebugging
Enable/disable blob debugging.
string GetDeviceName(int nDeviceID)
Returns the device name of a given device ID.
int MaximumIteration
Returns the maximum iteration.
void AddCancelOverride(CancelEvent evtCancel)
Add a cancel override.
void AddCancelOverrideByName(string strEvtCancel)
Add a cancel override.
void RemoveCancelOverrideByName(string strEvtCancel)
Remove a cancel override.
bool VerifyCompute(string strExtra=null, int nDeviceID=-1, bool bThrowException=true)
VerifyCompute compares the current compute of the current device (or device specified) against the re...
bool ReInitializeParameters(WEIGHT_TARGET target, params string[] rgstrLayers)
Re-initializes each of the specified layers by re-running the filler (if any) specified by the layer....
string CurrentDevice
Returns the name of the current device used.
bool EnableLayerDebugging
Enable/disable layer debugging which causes each layer to check for NAN/INF on each forward/backward ...
void RemoveCancelOverride(CancelEvent evtCancel)
Remove a cancel override.
int GetDeviceCount()
Returns the total number of devices installed on this computer.
bool EnableBreakOnFirstNaN
Enable/disable break training after first detecting a NaN.
bool EnableDetailedNanDetection
When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is pero...
string LabelQueryHitPercents
Returns a string describing the label query hit percentages observed during training.
List< int > ActiveGpus
Returns a list of Active GPU's used by the control.
int CurrentIteration
Returns the current iteration.
string ActiveLabelCounts
Returns a string describing the active label counts observed during training.
bool EnableSingleStep
Enable/disable single step training.
void SetOnTestOverride(EventHandler< TestArgs > onTest)
Sets the root solver's onTest event function.
The IXPersist interface is used by the CaffeControl to load and save weights.
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
SolverState LoadSolverState(byte[] rgState, SolverParameter.SolverType type=SolverParameter.SolverType.SGD)
Load the solver state from a byte array.
WeightInfo< T > LoadWeightInfo(BlobCollection< T > colBlobs)
Returns the weight information describing the weights containined within the Blob collection.
WeightInfo< T > LoadWeightInfo(byte[] rgWeights)
Returns the weight information describing the weights containined within the weight bytes.
byte[] SaveSolverState(SolverState state, SolverParameter.SolverType type=SolverParameter.SolverType.SGD)
Save the solver state to a byte array.
byte[] SaveWeights(BlobCollection< T > colBlobs, bool bSaveDiffs=false)
Save the weights to a byte array.
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_ITEM_SELECTION_METHOD
Defines the item (e.g., image or temporal item) selection method.
Phase
Defines the Phase under which to run a Net.
DB_LABEL_SELECTION_METHOD
Defines the label selection method.
@ DATA
Specifies a data gym that collects data from a data source, such as a database.
@ NONE
No training category specified.
The MyCaffe.common namespace contains common MyCaffe classes.
delegate void onSetWorkspace(object sender, WorkspaceArgs e)
Delegate used to set the OnSetworkspace event.
BLOB_TYPE
Defines the tpe of data held by a given Blob.
@ ATTENTION
The blob contains attention scores.
@ MULTIBBOX
The blob holds multi-boundingbox data.
@ ACCURACY
The Blob holds Accuracy Data.
@ INTERNAL
The blob is an internal blob used within the layer.
@ UNKNOWN
The blob is an unknown type.
@ TARGET
The blob contains target data.
@ IP_WEIGHT
The Blob holds an inner product weight.
@ CLIP
The blob holds Clip data.
@ PREDICTION
The blob contains prediction data.
@ LOSS
The Blob holds Loss Data.
delegate void onGetWorkspace(object sender, WorkspaceArgs e)
Delegate used to set the OnGetworkspace event.
TRAIN_STEP
Defines the training stepping method (if any).
@ BACKWARD
Step only in the backward direction.
@ FORWARD
Step only in the forward direction.
WEIGHT_TARGET
Defines the type of weight to target in re-initializations.
@ BOTH
Both weights and bias are targeted.
@ BIAS
Bias weights are targeted.
@ WEIGHTS
Generic weights are targeted.
The MyCaffe.db.image namespace contains all image database related classes.
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-...