MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The MyCaffeControl is the main object used to manage all training, testing and running of the MyCaffe system. More...
Public Member Functions | |
MyCaffeControl (SettingsCaffe settings, Log log, CancelEvent evtCancel, AutoResetEvent evtSnapshot=null, AutoResetEvent evtForceTest=null, ManualResetEvent evtPause=null, List< int > rgGpuId=null, string strCudaPath="", bool bCreateCudaDnn=false, ConnectInfo ci=null) | |
The MyCaffeControl constructor. More... | |
void | dispose () |
Releases all GPU and Host resources used by the CaffeControl. More... | |
MyCaffeControl< T > | Clone (int nGpuID) |
Clone the current instance of the MyCaffeControl creating a second instance. More... | |
void | CopyGradientsFrom (MyCaffeControl< T > src) |
Copy the learnable parameter diffs from the source MyCaffeControl into this one. More... | |
void | CopyWeightsFrom (MyCaffeControl< T > src) |
Copy the learnable parameter data from the source MyCaffeControl into this one. More... | |
double | ApplyUpdate (int nIteration) |
Directs the solver to apply the leanred blob diffs to the weights using the solver's learning rate and update algorithm. More... | |
void | Unload (bool bUnloadImageDb=true, bool bIgnoreExceptions=false) |
Unload the currently loaded project, if any. More... | |
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. When the 'rgstr' parameter is null or otherwise empty, the blobs of all layers are re-initialized. More... | |
void | SetOnTestOverride (EventHandler< TestArgs > onTest) |
Sets the root solver's onTest event function. More... | |
void | SetOnTrainingStartOverride (EventHandler onTrainingStart) |
Sets the root solver's onStart event function triggered on the start of each training pass. More... | |
void | SetOnTestingStartOverride (EventHandler onTestingStart) |
Sets the root solver's onTestingStart event function triggered on the start of each testing pass. More... | |
void | AddCancelOverrideByName (string strEvtCancel) |
Adds a cancel override. More... | |
void | AddCancelOverride (CancelEvent evtCancel) |
Adds a cancel override. More... | |
void | RemoveCancelOverrideByName (string strEvtCancel) |
Remove a cancel override. More... | |
void | RemoveCancelOverride (CancelEvent evtCancel) |
Remove a cancel override. More... | |
int | GetDeviceCount () |
Returns the total number of devices installed on this computer. More... | |
string | GetDeviceName (int nDeviceID) |
Returns the device name of a given device ID. More... | |
void | PrepareImageMeans (ProjectEx prj) |
Prepare the testing image mean by copying the training image mean if the testing image mean is missing. More... | |
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. More... | |
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. More... | |
bool | LoadLite (Phase phase, string strSolver, string strModel, byte[] rgWeights=null, bool bResetFirst=false, bool bCreateRunNet=true, SimpleDatum sdMean=null, string strStage=null, bool bEnableMemTrace=false) |
Load a solver and model without using the MyCaffeImageDatabase. More... | |
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). More... | |
bool | CompareWeights (Net< T > net1, Net< T > net2) |
The CompareWeights method compares the weights held in two different Net objects. More... | |
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. More... | |
double | Test (int nIterationOverride=-1) |
Test the network a given number of iterations. More... | |
PropertySet | TestMany (PropertySet customInput) |
Test on custom input data. More... | |
BlobCollection< T > | TestManyEx (PropertySet customInput) |
Test on custom input data. More... | |
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 network, and then comparing the results with the expected results. More... | |
ResultCollection | Run (int nImageIdx, bool bPad=true) |
Run on a given image in the MyCaffeImageDatabase based on its image index. More... | |
List< ResultCollection > | Run (List< int > rgImageIdx, ref Blob< T > blob) |
Run on a set of images in the MyCaffeImageDatabase based on their image indexes. More... | |
List< ResultCollection > | Run (List< int > rgImageIdx) |
Run on a set of images in the MyCaffeImageDatabase based on their image indexes. More... | |
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 returned. More... | |
ResultCollection | Run (SimpleDatum d, bool bSort, bool bUseSolverNet, bool bPad=true) |
Run on a given Datum. More... | |
List< ResultCollection > | Run (List< SimpleDatum > rgSd, ref Blob< T > blob, bool bUseSolverNet=false, int nMax=int.MaxValue) |
Run on a given list of Datum. More... | |
List< ResultCollection > | Run (Blob< T > blob, bool bSort=true, bool bUseSolverNet=false, int nMax=int.MaxValue, List< int > rgIgnoreLabels=null) |
Run on a Blob of data. More... | |
ResultCollection | Run (Bitmap img, bool bSort=true, bool bPad=true) |
Run on a given bitmap image. More... | |
ResultCollection | Run (SimpleDatum d, bool bSort=true, bool bPad=true) |
Run on a given Datum. More... | |
PropertySet | RunModel (PropertySet customInput) |
Run the model using data from the model itself - requires a Data layer with the RUN phase. More... | |
BlobCollection< T > | RunModelEx (PropertySet customInput) |
Run the model using data from the model itself - requires a Data layer with the RUN phase. More... | |
PropertySet | Run (PropertySet customInput, int nK=1, double dfThreshold=0.01, int nMax=80, bool bBeamSearch=false) |
Run the model on custom input data. More... | |
BlobCollection< T > | Run (BlobCollection< T > colBottom) |
Run the network forward on the bottom blobs. More... | |
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. More... | |
Bitmap | GetTestImage (Phase phase, int nLabel) |
Retrieves a random image from either the training or test set depending on the Phase specified. More... | |
Bitmap | GetTargetImage (int nSrcId, int nIdx, out int nLabel, out string strLabel, out byte[] rgCriteria, out SimpleDatum.DATA_FORMAT fmtCriteria) |
Retrives the image at a given index within the Testing data set. More... | |
Bitmap | GetTargetImage (int nImageID, out int nLabel, out string strLabel, out byte[] rgCriteria, out SimpleDatum.DATA_FORMAT fmtCriteria) |
Retrives the image with a given ID. More... | |
SimpleDatum | GetItemMean () |
Returns the item (e.g., image or temporal item) mean used by the solver network used during training. More... | |
DatasetDescriptor | GetDataset () |
Returns the current dataset used when training and testing. More... | |
byte[] | GetWeights () |
Retrieves the weights of the training network. More... | |
void | UpdateRunWeights (bool bOutputStatus=false, bool bVerifyWeights=true) |
Loads the weights from the training net into the Net used for running. More... | |
void | UpdateWeights (byte[] rgWeights) |
Loads the training Net with new weights. More... | |
Net< T > | CreateNet (byte[] rgWeights, CudaDnn< T > cudaOverride=null) |
Creates a new Net, loads the weights specified into it and returns it. More... | |
Net< T > | GetInternalNet (Phase phase=Phase.RUN) |
Returns the internal net based on the Phase specified: TRAIN, TEST or RUN. More... | |
Solver< T > | GetInternalSolver () |
Get the internal solver. More... | |
void | Snapshot (bool bUpdateDatabase=true) |
The Snapshot function forces a snapshot to occur. More... | |
string | GetLicenseText (string strOtherLicenses) |
Returns the license text for MyCaffe. More... | |
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 required compute of the current CudaDnnDLL.dll used. More... | |
Blob< T > | CreateBlob (string strName) |
Create an unsized blob and set its name. More... | |
long | CreateExtension (string strExtensionDLLPath) |
Create and load a new extension DLL. More... | |
void | FreeExtension (long hExtension) |
Free an existing extension and unload it. More... | |
T[] | RunExtension (long hExtension, long lfnIdx, T[] rgParam) |
Run a function on an existing extension. More... | |
double[] | RunExtensionD (long hExtension, long lfnIdx, double[] rgParam) |
Run a function on an existing extension using the double base type. More... | |
float[] | RunExtensionF (long hExtension, long lfnIdx, float[] rgParam) |
Run a function on an existing extension using the float base type. More... | |
Public Member Functions inherited from System.ComponentModel.Component | |
Component () | |
Static Public Member Functions | |
static NetParameter | CreateNetParameterForRunning (BlobShape shape, string strModel, out TransformationParameter transform_param, Stage stage=Stage.NONE, bool bSkipLossLayer=false, bool bMaintainBatchSize=false) |
Creates a net parameter for the RUN phase. More... | |
static void | ResetDevice (int nDeviceID) |
Reset the device at the given device ID. More... | |
static string | GetLicenseTextEx (string strOtherLicenses) |
Returns the license text for MyCaffe. More... | |
Protected Member Functions | |
NetParameter | createNetParameterForRunning (ProjectEx p, out TransformationParameter transform_param) |
Creates a net parameter for the RUN phase. More... | |
NetParameter | createNetParameterForRunning (DatasetDescriptor ds, string strModel, out TransformationParameter transform_param, Stage stage=Stage.NONE) |
Creates a net parameter for the RUN phase. More... | |
NetParameter | createNetParameterForRunning (BlobShape shape, string strModel, out TransformationParameter transform_param, Stage stage=Stage.NONE) |
Creates a net parameter for the RUN phase. More... | |
NetParameter | createNetParameterForRunning (SimpleDatum sdMean, string strModel, out TransformationParameter transform_param, out int nC, out int nH, out int nW, Stage stage=Stage.NONE) |
Creates a net parameter for the RUN phase. More... | |
Protected Attributes | |
SettingsCaffe | m_settings |
The settings used to configure the control. More... | |
Log | m_log |
The log used for output. More... | |
IXDatabaseBase | m_db = null |
The image database. More... | |
bool | m_bDbOwner = true |
Whether or not the control owns the image database. More... | |
CancelEvent | m_evtCancel |
The CancelEvent used to cancel training and testing operations. More... | |
AutoResetEvent | m_evtForceSnapshot |
An auto-reset event used to force a snapshot. More... | |
AutoResetEvent | m_evtForceTest |
An auto-reset event used to force a test cycle. More... | |
ManualResetEvent | m_evtPause |
An auto-reset event used to pause training. More... | |
DataTransformer< T > | m_dataTransformer = null |
The data transformer used to transform data. More... | |
ProjectEx | m_project = null |
The active project (if any). More... | |
DatasetDescriptor | m_dataSet = null |
The dataset descriptor of the dataset used in the image database. More... | |
string | m_strCudaPath = null |
The low-level path of the underlying CudaDnn DLL. More... | |
List< int > | m_rgGpu |
A list of the Device ID's used for training. More... | |
Properties | |
static FileVersionInfo | Version [get] |
Get the file version of the MyCaffe assembly running. More... | |
ConnectInfo | DatasetConnectInfo [get] |
Returns the dataset connection information, if used (default = null). More... | |
string | CurrentStage [get] |
Returns the stage under which the project was loaded, if any. More... | |
bool | EnableTesting [getset] |
Enable/disable testing. For example reinforcement learning does not use testing. More... | |
bool | EnableVerboseStatus [getset] |
Get/set whether or not to use verbose status. When enabled, the full status is output when loading a project, otherwise a more minimum (faster) set is output (default = false for disabled). More... | |
bool? | EnableBlobDebugging [getset] |
Enable/disable blob debugging. More... | |
bool? | EnableBreakOnFirstNaN [getset] |
Enable/disable break training after first detecting a NaN. More... | |
bool? | EnableDetailedNanDetection [getset] |
When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net. More... | |
bool? | EnableLayerDebugging [getset] |
Enable/disable layer debugging which causes each layer to check for NAN/INF on each forward/backward pass and throw an exception when found. More... | |
bool? | EnableSingleStep [getset] |
Enable/disable single step training. More... | |
DataTransformer< T > | DataTransformer [get] |
Returns the DataTransormer used. More... | |
SettingsCaffe | Settings [get] |
Returns the settings used to create the control. More... | |
CudaDnn< T > | Cuda [get] |
Returns the CudaDnn connection used. More... | |
Log | Log [get] |
Returns the Log (for output) used. More... | |
IXPersist< T > | Persist [get] |
Returns the persist used to load and save weights. More... | |
IXDatabaseBase | Database [get] |
Returns the MyCaffeImageDatabase or MyCaffeTemporalDatabase used. More... | |
CancelEvent | CancelEvent [get] |
Returns the CancelEvent used. More... | |
List< int > | ActiveGpus [get] |
Returns a list of Active GPU's used by the control. More... | |
string | ActiveLabelCounts [get] |
Returns a string describing the active label counts observed during training. More... | |
string | LabelQueryHitPercents [get] |
Returns a string describing the label query hit percentages observed during training. More... | |
string | LabelQueryEpochs [get] |
Returns a string describing the label query epochs observed during training. More... | |
string | CurrentDevice [get] |
Returns the name of the current device used. More... | |
ProjectEx | CurrentProject [get] |
Returns the name of the currently loaded project. More... | |
int | CurrentIteration [get] |
Returns the current iteration. More... | |
int | MaximumIteration [get] |
Returns the maximum iteration. More... | |
Phase | LastPhase [get] |
Returns the last phase run (TRAIN, TEST or RUN). More... | |
Properties inherited from MyCaffe.common.IXMyCaffeState< T > | |
bool | EnableBlobDebugging [getset] |
Enable/disable blob debugging. More... | |
bool | EnableBreakOnFirstNaN [getset] |
Enable/disable break training after first detecting a NaN. More... | |
bool | EnableDetailedNanDetection [getset] |
When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net. More... | |
bool | EnableSingleStep [getset] |
Enable/disable single step training. More... | |
bool | EnableLayerDebugging [getset] |
Enable/disable layer debugging which causes each layer to check for NAN/INF on each forward/backward pass and throw an exception when found. More... | |
IXPersist< T > | Persist [get] |
Returns the persist used to load and save weights. More... | |
IXDatabaseBase | Database [get] |
Returns the in-memory MyCaffeDatabase used. More... | |
CancelEvent | CancelEvent [get] |
Returns the CancelEvent used. More... | |
List< int > | ActiveGpus [get] |
Returns a list of Active GPU's used by the control. More... | |
string | ActiveLabelCounts [get] |
Returns a string describing the active label counts observed during training. More... | |
string | LabelQueryHitPercents [get] |
Returns a string describing the label query hit percentages observed during training. More... | |
string | LabelQueryEpochs [get] |
Returns a string describing the label query epochs observed during training. More... | |
string | CurrentDevice [get] |
Returns the name of the current device used. More... | |
ProjectEx | CurrentProject [get] |
Returns the name of the currently loaded project. More... | |
int | CurrentIteration [get] |
Returns the current iteration. More... | |
int | MaximumIteration [get] |
Returns the maximum iteration. More... | |
Events | |
EventHandler< SnapshotArgs > | OnSnapshot |
The OnSnapshot event fires each time a snap-shot is taken. More... | |
EventHandler< TrainingIterationArgs< T > > | OnTrainingIteration |
The OnTrainingIteration event fires at the end of each training iteration. More... | |
EventHandler< TestingIterationArgs< T > > | OnTestingIteration |
The OnTestingIteration event fires at the end of each testing iteration. More... | |
The MyCaffeControl is the main object used to manage all training, testing and running of the MyCaffe system.
T | Specifies the base type float or double. Using float is recommended to conserve GPU memory. |
Definition at line 34 of file MyCaffeControl.cs.
MyCaffe.MyCaffeControl< T >.MyCaffeControl | ( | SettingsCaffe | settings, |
Log | log, | ||
CancelEvent | evtCancel, | ||
AutoResetEvent | evtSnapshot = null , |
||
AutoResetEvent | evtForceTest = null , |
||
ManualResetEvent | evtPause = null , |
||
List< int > | rgGpuId = null , |
||
string | strCudaPath = "" , |
||
bool | bCreateCudaDnn = false , |
||
ConnectInfo | ci = null |
||
) |
The MyCaffeControl constructor.
settings | Specifies the setting used to configure the MyCaffeControl. |
log | Specifies the Log for all output. |
evtCancel | Specifies the CancelEvent used to abort training and testing operations. |
evtSnapshot | Optionally, specifies an auto reset event used to force a snap-shot. |
evtForceTest | Optionally, specifies an auto reset event used to force a test cycle. |
evtPause | Optionally, specifies an auto reset event used to pause training. |
rgGpuId | Optionally, specfies a set of GPU ID's that override those specified in the SettingsCaffe object. |
strCudaPath | Optionally, specifies the path to the low-lever CudaDnnDll.DLL file. Note, when not set, the system looks in the same directory of the executing assembly for the low-level DLL. |
bCreateCudaDnn | Optionally, specififies create the connection to CUDA (default = false, causing the creation to occur during Load). |
ci | Optionally, specifies the connection information used to connect to the dataset. |
Definition at line 136 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.AddCancelOverride | ( | CancelEvent | evtCancel | ) |
Adds a cancel override.
evtCancel | Specifies the new name of the cancel event to add. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 496 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.AddCancelOverrideByName | ( | string | strEvtCancel | ) |
Adds a cancel override.
strEvtCancel | Specifies the new name of the cancel event to add. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 487 of file MyCaffeControl.cs.
double MyCaffe.MyCaffeControl< T >.ApplyUpdate | ( | int | nIteration | ) |
Directs the solver to apply the leanred blob diffs to the weights using the solver's learning rate and update algorithm.
nIteration | Specifies the current iteration. |
Definition at line 359 of file MyCaffeControl.cs.
MyCaffeControl< T > MyCaffe.MyCaffeControl< T >.Clone | ( | int | nGpuID | ) |
Clone the current instance of the MyCaffeControl creating a second instance.
The second instance has the same project loaded and a copy of the first instance's weights.
nGpuID | Specifies the GPUID on which to load the second instance. |
Definition at line 285 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.CompareWeights | ( | Net< T > | net1, |
Net< T > | net2 | ||
) |
The CompareWeights method compares the weights held in two different Net objects.
net1 | Specifies the first Net to compare. |
net2 | Specifies the second Net to compare. |
Definition at line 1800 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.CopyGradientsFrom | ( | MyCaffeControl< T > | src | ) |
Copy the learnable parameter diffs from the source MyCaffeControl into this one.
src | Specifies the source MyCaffeControl whos gradients (blob diffs) are to be copied. |
Definition at line 317 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.CopyWeightsFrom | ( | MyCaffeControl< T > | src | ) |
Copy the learnable parameter data from the source MyCaffeControl into this one.
src | Specifies the source MyCaffeControl whos gradients (blob data) are to be copied. |
Definition at line 337 of file MyCaffeControl.cs.
Blob< T > MyCaffe.MyCaffeControl< T >.CreateBlob | ( | string | strName | ) |
Create an unsized blob and set its name.
strName | Specifies the Blob name. |
Definition at line 3496 of file MyCaffeControl.cs.
Blob< T > MyCaffe.MyCaffeControl< 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 returned.
d | Specifies the datum to load into the blob. |
blob | Optionally, specifies a blob to use instead of creating a new one. |
bPad | Optionally, pad the blob with an extra item (default = false). |
Implements MyCaffe.common.IXMyCaffeNoDb< T >.
Definition at line 2460 of file MyCaffeControl.cs.
long MyCaffe.MyCaffeControl< T >.CreateExtension | ( | string | strExtensionDLLPath | ) |
Create and load a new extension DLL.
strExtensionDLLPath | Specifies the path to the extension DLL. |
Implements MyCaffe.common.IXMyCaffeExtension< T >.
Definition at line 3508 of file MyCaffeControl.cs.
Net< T > MyCaffe.MyCaffeControl< T >.CreateNet | ( | byte[] | rgWeights, |
CudaDnn< T > | cudaOverride = null |
||
) |
Creates a new Net, loads the weights specified into it and returns it.
rgWeights | Specifies the weights to load. |
cudaOverride | Optionally, specifies a different cuda instance for the Net to use. |
Definition at line 3304 of file MyCaffeControl.cs.
|
protected |
Creates a net parameter for the RUN phase.
This function transforms the training net parameter into a new net parameter suitable to run in the RUN phase.
shape | Specifies the shape of the images that will be used. |
strModel | Specifies the model descriptor. |
transform_param | Specifies the TransformationParameter to use. |
stage | Optionally, specifies the stage to create the run network on. |
Definition at line 798 of file MyCaffeControl.cs.
|
static |
Creates a net parameter for the RUN phase.
This function transforms the training net parameter into a new net parameter suitable to run in the RUN phase.
shape | Specifies the shape of the images that will be used. |
strModel | Specifies the model descriptor. |
transform_param | Specifies the TransformationParameter to use. |
stage | Optionally, specifies the stage to create the run network on. |
bSkipLossLayer | Optionally, specifies to skip the loss layer and not output a converted layer to replace it (default = false). |
bMaintainBatchSize | Optionally, specifies to keep the batch size, otherwise batch size is set to 1 (default = false). |
Definition at line 882 of file MyCaffeControl.cs.
|
protected |
Creates a net parameter for the RUN phase.
This function transforms the training net parameter into a new net parameter suitable to run in the RUN phase.
ds | Specifies a DatasetDescriptor for the dataset used. |
strModel | Specifies the model descriptor. |
transform_param | Specifies the TransformationParameter to use. |
stage | Optionally, specifies the stage to create the run network on. |
Definition at line 781 of file MyCaffeControl.cs.
|
protected |
Creates a net parameter for the RUN phase.
This function transforms the training net parameter into a new net parameter suitable to run in the RUN phase.
p | Specifies a project. |
transform_param | Specifies the TransformationParameter to use. |
Definition at line 765 of file MyCaffeControl.cs.
|
protected |
Creates a net parameter for the RUN phase.
This function transforms the training net parameter into a new net parameter suitable to run in the RUN phase.
sdMean | Specifies the mean image data used to size the network and as the mean image when used in the transformation parameter. |
strModel | Specifies the model descriptor. |
transform_param | Returns the TransformationParameter to use. |
nC | Returns the discovered channel sizing to use. |
nH | Returns the discovered height sizing to use. |
nW | Returns the discovered width sizing to use. |
stage | Optionally, specifies the stage to create the run network on. |
Definition at line 819 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.dispose | ( | ) |
Releases all GPU and Host resources used by the CaffeControl.
Definition at line 191 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.FreeExtension | ( | long | hExtension | ) |
Free an existing extension and unload it.
hExtension | Specifies the handle to the extension to free. |
Implements MyCaffe.common.IXMyCaffeExtension< T >.
Definition at line 3517 of file MyCaffeControl.cs.
DatasetDescriptor MyCaffe.MyCaffeControl< T >.GetDataset | ( | ) |
Returns the current dataset used when training and testing.
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3179 of file MyCaffeControl.cs.
int MyCaffe.MyCaffeControl< T >.GetDeviceCount | ( | ) |
Returns the total number of devices installed on this computer.
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 733 of file MyCaffeControl.cs.
string MyCaffe.MyCaffeControl< T >.GetDeviceName | ( | int | nDeviceID | ) |
Returns the device name of a given device ID.
nDeviceID | Specifies the device ID. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 743 of file MyCaffeControl.cs.
Net< T > MyCaffe.MyCaffeControl< T >.GetInternalNet | ( | Phase | phase = Phase.RUN | ) |
Returns the internal net based on the Phase specified: TRAIN, TEST or RUN.
phase | Specifies the Phase used to select the Net. |
The following net is returned under the following conditions: phase = ALL, return the net from the LastPhase run. If the LastPhase run = NONE, return the RUN net. phase = n/a, return the default RUN net. phase = NONE, return the default RUN net. phase = TRAIN, return the training net. phase = TEST, return the testing net.
Definition at line 3328 of file MyCaffeControl.cs.
Solver< T > MyCaffe.MyCaffeControl< T >.GetInternalSolver | ( | ) |
SimpleDatum MyCaffe.MyCaffeControl< T >.GetItemMean | ( | ) |
Returns the item (e.g., image or temporal item) mean used by the solver network used during training.
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3158 of file MyCaffeControl.cs.
string MyCaffe.MyCaffeControl< T >.GetLicenseText | ( | string | strOtherLicenses | ) |
Returns the license text for MyCaffe.
strOtherLicenses | Specifies other licenses to append to the license text. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3401 of file MyCaffeControl.cs.
|
static |
Returns the license text for MyCaffe.
strOtherLicenses | Specifies other licenses to append to the license text. |
Definition at line 3380 of file MyCaffeControl.cs.
Bitmap MyCaffe.MyCaffeControl< T >.GetTargetImage | ( | int | nImageID, |
out int | nLabel, | ||
out string | strLabel, | ||
out byte[] | rgCriteria, | ||
out SimpleDatum.DATA_FORMAT | fmtCriteria | ||
) |
Retrives the image with a given ID.
nImageID | Specifies the Raw Image ID. |
nLabel | Returns the expected label for the image. |
strLabel | Returns the expected label name for the image. |
rgCriteria | Returns the data criteria if one exists. |
fmtCriteria | Returns the format of the data criteria, if one exists. |
Definition at line 3135 of file MyCaffeControl.cs.
Bitmap MyCaffe.MyCaffeControl< T >.GetTargetImage | ( | int | nSrcId, |
int | nIdx, | ||
out int | nLabel, | ||
out string | strLabel, | ||
out byte[] | rgCriteria, | ||
out SimpleDatum.DATA_FORMAT | fmtCriteria | ||
) |
Retrives the image at a given index within the Testing data set.
nSrcId | Specifies the Source ID. |
nIdx | Specifies the image index. |
nLabel | Returns the expected label for the image. |
strLabel | Returns the expected label name for the image. |
rgCriteria | Returns the data criteria if one exists. |
fmtCriteria | Returns the format of the data criteria, if one exists. |
Definition at line 3106 of file MyCaffeControl.cs.
Bitmap MyCaffe.MyCaffeControl< T >.GetTestImage | ( | Phase | phase, |
int | nLabel | ||
) |
Retrieves a random image from either the training or test set depending on the Phase specified.
phase | Specifies whether to select images from the training set or testing set. |
nLabel | Returns the expected label for the image. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3084 of file MyCaffeControl.cs.
Bitmap MyCaffe.MyCaffeControl< T >.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.
phase | Specifies whether to select images from the training set or testing set. |
nLabel | Returns the expected label for the image. |
strLabel | Returns the expected label name for the image. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3060 of file MyCaffeControl.cs.
byte[] MyCaffe.MyCaffeControl< T >.GetWeights | ( | ) |
Retrieves the weights of the training network.
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3188 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.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.
This load function uses the MyCaffeImageDatabase.
phase | Specifies the Phase for which the load should focus. |
p | Specifies the Project to load. |
labelSelectionOverride | Optionally, specifies the label selection override (overides the label selection in SettingsCaffe). The label selection dictates how the label sets are selected. |
itemSelectionOverride | Optionally, specifies the item (e.g., image or temporal item) selection override (overides the item selection in SettingsCaffe). The item selection dictates how the items are selected from each label set. |
bResetFirst | Optionally, resets the device before loading. IMPORTANT: this functionality is only recommendned during testing, for resetting the device will throw off all other users of the device. |
db | Optionally, specifies the MyCaffeImageDatabase or MyCaffeTemporalDatabase to use. When null, an instance if the in-memory database is created internally. |
bUseDb | Optionally, specifies to use the in-memory database based on the DB_VERSION specified in the settings. |
bCreateRunNet | Optionally, specifies whether or not to create the Run net. |
strStage | Optionally, specifies a stage under which to load the model. |
bEnableMemTrace | Optionally, specifies to enable the memory tracing (only available in debug builds). |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 1070 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.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.
This load function uses the MyCaffeImageDatabase.
phase | Specifies the Phase for which the load should focus. |
strSolver | Specifies the solver descriptor. |
strModel | Specifies the model desciptor. |
rgWeights | Optionally, specifies the weights to load, or null to ignore. |
labelSelectionOverride | Optionally, specifies the label selection override (overides the label selection in SettingsCaffe). The label selection dictates how the label sets are selected. |
itemSelectionOverride | Optionally, specifies the item (e.g., image or temporal item) selection override (overides the item selection in SettingsCaffe). The item selection dictates how the item are selected from each label set. |
bResetFirst | Optionally, resets the device before loading. IMPORTANT: this functionality is only recommendned during testing, for resetting the device will throw off all other users of the device. |
db | Optionally, specifies the in-memory MyCaffeDatabase to use. When null, an instance if the MyCaffeImageDatabase or MyCaffeTemporalDatabase is created internally depending on the DB_VERSION used. |
bUseDb | Optionally, specifies to use the in-memory database based on the DB_VERSION specified in the settings. |
bCreateRunNet | Optionally, specifies whether or not to create the Run net (default = true). |
strStage | Optionally, specifies a stage under which to load the model. |
bEnableMemTrace | Optionally, specifies to enable the memory tracing (only available in debug builds). |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 1298 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.LoadLite | ( | Phase | phase, |
string | strSolver, | ||
string | strModel, | ||
byte[] | rgWeights = null , |
||
bool | bResetFirst = false , |
||
bool | bCreateRunNet = true , |
||
SimpleDatum | sdMean = null , |
||
string | strStage = null , |
||
bool | bEnableMemTrace = false |
||
) |
Load a solver and model without using the MyCaffeImageDatabase.
This load function is a load lite that does not use the MyCaffeImageDatabase.
phase | Specifies the Phase for which the load should focus. |
strSolver | Specifies the solver descriptor. |
strModel | Specifies the model desciptor. |
rgWeights | Optionally, specifies the weights to load, or null to ignore (default = null). |
bResetFirst | Optionally, resets the device before loading. IMPORTANT: this functionality is only recommendned during testing, for resetting the device will throw off all other users of the device. |
bCreateRunNet | Optionally, specifies whether or not to create the Run net (default = true). |
sdMean | Optionally, specifies the image mean to use (default = null). |
strStage | Optionally, specifies a stage under which to load the model. |
bEnableMemTrace | Optionally, specifies to enable the memory tracing (only available in debug builds). |
Definition at line 1512 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.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).
This method does not use the MyCaffeImageDatabase.
strModel | Specifies the model description to load. |
rgWeights | Specifies the trained weights to load. |
shape | Specifies the expected shape to run on. |
sdMean | Optionally, specifies the simple datum mean to subtract from input images that are run. |
transParam | Optionally, specifies the TransformationParameter to use. When using a 'deployment' model that has no data layers, you should supply a transformation parameter that matches the transformation used during training. |
bForceBackward | Optionally, specifies to force backward propagation in the event that a backward pass is to be run on the Run net - The DeepDraw functionality uses this setting so that it can view what the trained weights actually see. |
bConvertToRunNet | When true, the 'strModel' is converted from a training model to a run model, otherwise the model is used unaltered (default = true) |
Implements MyCaffe.common.IXMyCaffeNoDb< T >.
Definition at line 1637 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.PrepareImageMeans | ( | ProjectEx | prj | ) |
Prepare the testing image mean by copying the training image mean if the testing image mean is missing.
prj | Specifies the project whos image mean is to be prepared. |
Definition at line 994 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.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.
When the 'rgstr' parameter is null or otherwise empty, the blobs of all layers are re-initialized.
target | Specifies the weights to target (e.g. weights, bias or both). |
rgstrLayers | Specifies the layers to reinitialize, when null or empty, all layers are re-initialized |
This method causes the OnTrainingIteration event to fire with the updated values from the re-init.
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 448 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.RemoveCancelOverride | ( | CancelEvent | evtCancel | ) |
Remove a cancel override.
evtCancel | Specifies the new name of the cancel event to remove. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 514 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.RemoveCancelOverrideByName | ( | string | strEvtCancel | ) |
Remove a cancel override.
strEvtCancel | Specifies the new name of the cancel event to remove. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 505 of file MyCaffeControl.cs.
|
static |
Reset the device at the given device ID.
WARNING! It is recommended that this only be used when testing, for calling this will throw off all other users of the device and may cause unpredictable behavior.
nDeviceID | Specifies the device ID of the device to reset. |
Definition at line 3371 of file MyCaffeControl.cs.
ResultCollection MyCaffe.MyCaffeControl< T >.Run | ( | Bitmap | img, |
bool | bSort = true , |
||
bool | bPad = true |
||
) |
Run on a given bitmap image.
This method does not use the MyCaffeImageDatabase.
img | Specifies the input image. |
bSort | Specifies whether or not to sort the results. |
bPad | Optionally, specifies to pad the input by 1. |
Implements MyCaffe.common.IXMyCaffeNoDb< T >.
Definition at line 2798 of file MyCaffeControl.cs.
List< ResultCollection > MyCaffe.MyCaffeControl< T >.Run | ( | Blob< T > | blob, |
bool | bSort = true , |
||
bool | bUseSolverNet = false , |
||
int | nMax = int.MaxValue , |
||
List< int > | rgIgnoreLabels = null |
||
) |
Run on a Blob of data.
blob | Specifies the blob of data. |
bSort | Optionally, specifies whether or not to sor the results. |
bUseSolverNet | Optionally, specifies whether or not to use the training net vs. the run net. |
nMax | Optionally, specifies a maximum number of SimpleDatums to process (default = int.MaxValue). |
rgIgnoreLabels | Optionally, specifies a set of labels to ignore. |
Definition at line 2680 of file MyCaffeControl.cs.
BlobCollection< T > MyCaffe.MyCaffeControl< T >.Run | ( | BlobCollection< T > | colBottom | ) |
Run the network forward on the bottom blobs.
colBottom | Specifies the input blobs. |
Definition at line 3032 of file MyCaffeControl.cs.
ResultCollection MyCaffe.MyCaffeControl< T >.Run | ( | int | nImageIdx, |
bool | bPad = true |
||
) |
Run on a given image in the MyCaffeImageDatabase based on its image index.
nImageIdx | Specifies the image index. |
bPad | PAdd the input with an extra input image. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 2386 of file MyCaffeControl.cs.
List< ResultCollection > MyCaffe.MyCaffeControl< T >.Run | ( | List< int > | rgImageIdx | ) |
Run on a set of images in the MyCaffeImageDatabase based on their image indexes.
rgImageIdx | Specifies a list of image indexes. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 2418 of file MyCaffeControl.cs.
List< ResultCollection > MyCaffe.MyCaffeControl< T >.Run | ( | List< int > | rgImageIdx, |
ref Blob< T > | blob | ||
) |
Run on a set of images in the MyCaffeImageDatabase based on their image indexes.
rgImageIdx | Specifies a list of image indexes. |
blob | Specifies a work blob. |
Definition at line 2399 of file MyCaffeControl.cs.
List< ResultCollection > MyCaffe.MyCaffeControl< T >.Run | ( | List< SimpleDatum > | rgSd, |
ref Blob< T > | blob, | ||
bool | bUseSolverNet = false , |
||
int | nMax = int.MaxValue |
||
) |
Run on a given list of Datum.
rgSd | Specifies the list of Datum to run. |
blob | Specifies a work blob. |
bUseSolverNet | Optionally, specifies whether or not to use the training net vs. the run net. |
nMax | Optionally, specifies a maximum number of SimpleDatums to process (default = int.MaxValue). |
Definition at line 2599 of file MyCaffeControl.cs.
PropertySet MyCaffe.MyCaffeControl< T >.Run | ( | PropertySet | customInput, |
int | nK = 1 , |
||
double | dfThreshold = 0.01 , |
||
int | nMax = 80 , |
||
bool | bBeamSearch = false |
||
) |
Run the model on custom input data.
customInput | Specifies the custom input data. |
nK | Optionally, specifies the number of items to use in the search where nK=1 runs a greedy search and any values > 1 run a beam search with that width. |
dfThreshold | Specifies the threshold where detected items with probabilities less than the threshold are ignored (default = 0.01). |
nMax | Optionally, specifies the maximum number of outputs (default = 80). |
bBeamSearch | Optionally, specifies to run a Beam Search. |
Definition at line 2906 of file MyCaffeControl.cs.
ResultCollection MyCaffe.MyCaffeControl< T >.Run | ( | SimpleDatum | d, |
bool | bSort, | ||
bool | bUseSolverNet, | ||
bool | bPad = true |
||
) |
Run on a given Datum.
d | Specifies the Datum to run. |
bSort | Specifies whether or not to sor the results. |
bUseSolverNet | Optionally, specifies whether or not to use the training net vs. the run net. |
bPad | Optionally, specifies to pad the data with a dummy trailing item (default = true). |
Definition at line 2507 of file MyCaffeControl.cs.
ResultCollection MyCaffe.MyCaffeControl< T >.Run | ( | SimpleDatum | d, |
bool | bSort = true , |
||
bool | bPad = true |
||
) |
Run on a given Datum.
d | Specifies the Datum to run. |
bSort | Specifies whether or not to sort the results. |
bPad | Optionally, specifies to pad the data with a dummy item and reshape the net (default = false). |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 2818 of file MyCaffeControl.cs.
T[] MyCaffe.MyCaffeControl< T >.RunExtension | ( | long | hExtension, |
long | lfnIdx, | ||
T[] | rgParam | ||
) |
Run a function on an existing extension.
hExtension | Specifies the extension. |
lfnIdx | Specifies the function to run on the extension. |
rgParam | Specifies the parameters. |
Implements MyCaffe.common.IXMyCaffeExtension< T >.
Definition at line 3528 of file MyCaffeControl.cs.
double[] MyCaffe.MyCaffeControl< T >.RunExtensionD | ( | long | hExtension, |
long | lfnIdx, | ||
double[] | rgParam | ||
) |
Run a function on an existing extension using the double base type.
hExtension | Specifies the extension. |
lfnIdx | Specifies the function to run on the extension. |
rgParam | Specifies the parameters. |
Implements MyCaffe.common.IXMyCaffeExtension< T >.
Definition at line 3539 of file MyCaffeControl.cs.
float[] MyCaffe.MyCaffeControl< T >.RunExtensionF | ( | long | hExtension, |
long | lfnIdx, | ||
float[] | rgParam | ||
) |
Run a function on an existing extension using the float base type.
hExtension | Specifies the extension. |
lfnIdx | Specifies the function to run on the extension. |
rgParam | Specifies the parameters. |
Implements MyCaffe.common.IXMyCaffeExtension< T >.
Definition at line 3556 of file MyCaffeControl.cs.
PropertySet MyCaffe.MyCaffeControl< T >.RunModel | ( | PropertySet | customInput | ) |
Run the model using data from the model itself - requires a Data layer with the RUN phase.
customInput | Specifies custom inputs. Properties used: 'Phase' specifies the phase for which to run the model (e.g. which net to use), when missing, the default run net is used. |
Definition at line 2828 of file MyCaffeControl.cs.
BlobCollection< T > MyCaffe.MyCaffeControl< T >.RunModelEx | ( | PropertySet | customInput | ) |
Run the model using data from the model itself - requires a Data layer with the RUN phase.
customInput | Specifies custom inputs. Properties used: 'Phase' specifies the phase for which to run the model (e.g. which net to use), when missing, the default run net is used. |
Definition at line 2872 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.SetOnTestingStartOverride | ( | EventHandler | onTestingStart | ) |
Sets the root solver's onTestingStart event function triggered on the start of each testing pass.
onTestingStart | Specifies the event handler called when testing. |
Definition at line 477 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.SetOnTestOverride | ( | EventHandler< TestArgs > | onTest | ) |
Sets the root solver's onTest event function.
onTest | Specifies the event handler called when testing. |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 459 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.SetOnTrainingStartOverride | ( | EventHandler | onTrainingStart | ) |
Sets the root solver's onStart event function triggered on the start of each training pass.
onTrainingStart | Specifies the event handler called when testing. |
Definition at line 468 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.Snapshot | ( | bool | bUpdateDatabase = true | ) |
The Snapshot function forces a snapshot to occur.
bUpdateDatabase | Optionally, specifies to update the database (default = true). |
Definition at line 3358 of file MyCaffeControl.cs.
double MyCaffe.MyCaffeControl< T >.Test | ( | int | nIterationOverride = -1 | ) |
Test the network a given number of iterations.
nIterationOverride | Optionally, specifies number of iterations to run that override the iterations specified in the solver desctiptor. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 1942 of file MyCaffeControl.cs.
List< Tuple< SimpleDatum, ResultCollection > > MyCaffe.MyCaffeControl< T >.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 network, and then comparing the results with the expected results.
nCount | Specifies the number of cycles to run. |
bOnTrainingSet | Specifies on whether to select images from the training set, or when false the testing set of data. |
bOnTargetSet | Optionally, specifies to test on the target dataset (if exists) as opposed to the source dataset. The default is false, which tests on the default (source) dataset. |
imgSelMethod | Optionally, specifies the image selection method (default = RANDOM). |
nImageStartIdx | Optionally, specifies the image start index (default = 0). |
dtImageStartTime | Optionally, specifies the image start time (default = null). Note either the 'nImageStartIdx' or 'dtImageStartTime' may be used, but not both. |
dfThreshold | Optionally, specifies a threshold where the winning selection must also be above the threshold in score. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 2023 of file MyCaffeControl.cs.
PropertySet MyCaffe.MyCaffeControl< T >.TestMany | ( | PropertySet | customInput | ) |
Test on custom input data.
customInput | Specifies the custom input data separated by ';' characters. |
Running test many on custom data requires a MODEL dataset, where the data is queried from the model itself.
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 1961 of file MyCaffeControl.cs.
BlobCollection< T > MyCaffe.MyCaffeControl< T >.TestManyEx | ( | PropertySet | customInput | ) |
Test on custom input data.
customInput | Specifies the custom input data separated by ';' characters. |
Running test many on custom data requires a MODEL dataset, where the data is queried from the model itself.
Definition at line 1995 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.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.
nIterationOverride | Optionally, specifies number of iterations to run that override the iterations specified in the solver desctiptor. |
nTrainingTimeLimitInMinutes | Optionally, specifies a maximum number of minutes to train. When set to 0, this parameter is ignored and no time limit is imposed. |
step | Optionally, specifies whether or not to single step the training on the forward pass, backward pass or both. The default is TRAIN_STEP.NONE which runs the training to the maximum number of iterations specified. |
dfLearningRateOverride | Optionally, specifies a learning rate override (default = 0 which ignores this parameter) |
bReset | Optionally, reset the iterations to zero. |
Note when single stepping, no testing cycles are performed. Currently, the single-step parameter is only suppored when running in single GPU mode.
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 1876 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.Unload | ( | bool | bUnloadImageDb = true , |
bool | bIgnoreExceptions = false |
||
) |
Unload the currently loaded project, if any.
bUnloadImageDb | Optionally, specifies to unload the image database (default = true). |
bIgnoreExceptions | Optionally, specifies to ignore exceptions on error (default = false). |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 387 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.UpdateRunWeights | ( | bool | bOutputStatus = false , |
bool | bVerifyWeights = true |
||
) |
Loads the weights from the training net into the Net used for running.
bOutputStatus | Optionally, specifies to output status as the weights are updated (default = false). |
bVerifyWeights | Optionally, specifies to verify the run weights copied (default = true). |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3206 of file MyCaffeControl.cs.
void MyCaffe.MyCaffeControl< T >.UpdateWeights | ( | byte[] | rgWeights | ) |
Loads the training Net with new weights.
rgWeights | Specifies the weights to load. |
Implements MyCaffe.common.IXMyCaffe< T >.
Definition at line 3277 of file MyCaffeControl.cs.
bool MyCaffe.MyCaffeControl< T >.VerifyCompute | ( | string | strExtra = null , |
int | nDeviceID = -1 , |
||
bool | bThrowException = true |
||
) |
VerifyCompute compares the current compute of the current device (or device specified) against the required compute of the current CudaDnnDLL.dll used.
strExtra | Optionally, specifies extra information for the exception if one is thrown. |
nDeviceID | Optionally, specifies a specific device ID to check, otherwise uses the current device used (default = -1, which uses the current device). |
bThrowException | Optionally, specifies whether or not to throw an exception on a compute mis-match (default = true). |
Implements MyCaffe.common.IXMyCaffeState< T >.
Definition at line 3413 of file MyCaffeControl.cs.
|
protected |
Whether or not the control owns the image database.
Definition at line 51 of file MyCaffeControl.cs.
|
protected |
The dataset descriptor of the dataset used in the image database.
Definition at line 79 of file MyCaffeControl.cs.
|
protected |
The data transformer used to transform data.
Definition at line 71 of file MyCaffeControl.cs.
|
protected |
The image database.
Definition at line 47 of file MyCaffeControl.cs.
|
protected |
The CancelEvent used to cancel training and testing operations.
Definition at line 55 of file MyCaffeControl.cs.
|
protected |
An auto-reset event used to force a snapshot.
Definition at line 59 of file MyCaffeControl.cs.
|
protected |
An auto-reset event used to force a test cycle.
Definition at line 63 of file MyCaffeControl.cs.
|
protected |
An auto-reset event used to pause training.
Definition at line 67 of file MyCaffeControl.cs.
|
protected |
The log used for output.
Definition at line 43 of file MyCaffeControl.cs.
|
protected |
The active project (if any).
Definition at line 75 of file MyCaffeControl.cs.
|
protected |
A list of the Device ID's used for training.
Definition at line 87 of file MyCaffeControl.cs.
|
protected |
The settings used to configure the control.
Definition at line 39 of file MyCaffeControl.cs.
|
protected |
The low-level path of the underlying CudaDnn DLL.
Definition at line 83 of file MyCaffeControl.cs.
|
get |
Returns a list of Active GPU's used by the control.
Definition at line 655 of file MyCaffeControl.cs.
|
get |
Returns a string describing the active label counts observed during training.
This string can help diagnose label balancing issue.
Definition at line 666 of file MyCaffeControl.cs.
|
get |
Returns the CancelEvent used.
Definition at line 647 of file MyCaffeControl.cs.
|
get |
Returns the CudaDnn connection used.
Definition at line 615 of file MyCaffeControl.cs.
|
get |
Returns the name of the current device used.
Definition at line 696 of file MyCaffeControl.cs.
|
get |
Returns the current iteration.
Definition at line 716 of file MyCaffeControl.cs.
|
get |
Returns the name of the currently loaded project.
Definition at line 708 of file MyCaffeControl.cs.
|
get |
Returns the stage under which the project was loaded, if any.
Definition at line 272 of file MyCaffeControl.cs.
|
get |
Returns the MyCaffeImageDatabase or MyCaffeTemporalDatabase used.
Definition at line 639 of file MyCaffeControl.cs.
|
get |
Returns the dataset connection information, if used (default = null).
Definition at line 264 of file MyCaffeControl.cs.
|
get |
Returns the DataTransormer used.
Definition at line 599 of file MyCaffeControl.cs.
|
getset |
Enable/disable blob debugging.
Note, when enabled, training will dramatically slow down.
Definition at line 525 of file MyCaffeControl.cs.
|
getset |
Enable/disable break training after first detecting a NaN.
This option requires that EnableBlobDebugging == true.
Definition at line 541 of file MyCaffeControl.cs.
|
getset |
When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net.
Definition at line 554 of file MyCaffeControl.cs.
|
getset |
Enable/disable layer debugging which causes each layer to check for NAN/INF on each forward/backward pass and throw an exception when found.
This option dramatically slows down training and is only recommended during debugging.
Definition at line 570 of file MyCaffeControl.cs.
|
getset |
Enable/disable single step training.
This option requires that EnableBlobDebugging == true.
Definition at line 586 of file MyCaffeControl.cs.
|
getset |
Enable/disable testing. For example reinforcement learning does not use testing.
Definition at line 367 of file MyCaffeControl.cs.
|
getset |
Get/set whether or not to use verbose status. When enabled, the full status is output when loading a project, otherwise a more minimum (faster) set is output (default = false for disabled).
Definition at line 376 of file MyCaffeControl.cs.
|
get |
Returns a string describing the label query epochs observed during training.
This string can help diagnose label balancing issue.
Definition at line 688 of file MyCaffeControl.cs.
|
get |
Returns a string describing the label query hit percentages observed during training.
This string can help diagnose label balancing issue.
Definition at line 677 of file MyCaffeControl.cs.
|
get |
Returns the last phase run (TRAIN, TEST or RUN).
Definition at line 751 of file MyCaffeControl.cs.
|
get |
Returns the Log (for output) used.
Definition at line 623 of file MyCaffeControl.cs.
|
get |
Returns the maximum iteration.
Definition at line 724 of file MyCaffeControl.cs.
|
get |
Returns the persist used to load and save weights.
Definition at line 631 of file MyCaffeControl.cs.
|
get |
Returns the settings used to create the control.
Definition at line 607 of file MyCaffeControl.cs.
|
staticget |
Get the file version of the MyCaffe assembly running.
Definition at line 252 of file MyCaffeControl.cs.
EventHandler<SnapshotArgs> MyCaffe.MyCaffeControl< T >.OnSnapshot |
The OnSnapshot event fires each time a snap-shot is taken.
Definition at line 112 of file MyCaffeControl.cs.
EventHandler<TestingIterationArgs<T> > MyCaffe.MyCaffeControl< T >.OnTestingIteration |
The OnTestingIteration event fires at the end of each testing iteration.
Definition at line 120 of file MyCaffeControl.cs.
EventHandler<TrainingIterationArgs<T> > MyCaffe.MyCaffeControl< T >.OnTrainingIteration |
The OnTrainingIteration event fires at the end of each training iteration.
Definition at line 116 of file MyCaffeControl.cs.