MyCaffe  0.11.1.132-beta1
Deep learning software for Windows C# programmers.
MyCaffe.MyCaffeControl< T > Class Template Reference

The MyCaffeControl is the main object used to manage all training, testing and running of the MyCaffe system. More...

Inheritance diagram for MyCaffe.MyCaffeControl< T >:
System.ComponentModel.Component MyCaffe.common.IXMyCaffeState< T > MyCaffe.common.IXMyCaffe< T > MyCaffe.common.IXMyCaffeNoDb< T > MyCaffe.common.IXMyCaffeExtension< T >

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 (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 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, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, bool bResetFirst=false, IXImageDatabaseBase imgdb=null, bool bUseImageDb=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, IMGDB_LABEL_SELECTION_METHOD? labelSelectionOverride=null, IMGDB_IMAGE_SELECTION_METHOD? imageSelectionOverride=null, bool bResetFirst=false, IXImageDatabaseBase imgdb=null, bool bUseImageDb=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)
 The LoadToRun method loads the MyCaffeControl for running only (e.g. deployment). 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...
 
List< Tuple< SimpleDatum, ResultCollection > > TestMany (int nCount, bool bOnTrainingSet, bool bOnTargetSet=false, IMGDB_IMAGE_SELECTION_METHOD imgSelMethod=IMGDB_IMAGE_SELECTION_METHOD.RANDOM, int nImageStartIdx=0)
 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)
 Run on a given image in the MyCaffeImageDatabase based on its image index. More...
 
List< ResultCollectionRun (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)
 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)
 Run on a given Datum. More...
 
ResultCollection Run (Bitmap img, bool bSort=true)
 Run on a given bitmap image. More...
 
ResultCollection Run (SimpleDatum d, bool bSort=true)
 Run on a given Datum. 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 GetImageMean ()
 Returns the image 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 ()
 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 > GetNet (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)
 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...
 
List< ResultCollectionRun (List< SimpleDatum > rgSd, bool bSort=true, bool bUseSolverNet=false)
 Run on a given list of Datum. More...
 

Protected Attributes

SettingsCaffe m_settings
 The settings used to configure the control. More...
 
Log m_log
 The log used for output. More...
 
IXImageDatabaseBase m_imgDb = null
 The image database. More...
 
bool m_bImgDbOwner = 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

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 [get, set]
 Enable/disable testing. For example reinforcement learning does not use testing. More...
 
bool EnableVerboseStatus [get, set]
 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 [get, set]
 Enable/disable blob debugging. More...
 
bool EnableBreakOnFirstNaN [get, set]
 Enable/disable break training after first detecting a NaN. More...
 
bool EnableDetailedNanDetection [get, set]
 When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net. More...
 
bool EnableLayerDebugging [get, set]
 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 [get, set]
 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...
 
IXImageDatabaseBase ImageDatabase [get]
 Returns the MyCaffeImageDatabase 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 [get, set]
 Enable/disable blob debugging. More...
 
bool EnableBreakOnFirstNaN [get, set]
 Enable/disable break training after first detecting a NaN. More...
 
bool EnableDetailedNanDetection [get, set]
 When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net. More...
 
bool EnableSingleStep [get, set]
 Enable/disable single step training. More...
 
bool EnableLayerDebugging [get, set]
 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...
 
IXImageDatabaseBase ImageDatabase [get]
 Returns the MyCaffeImageDatabase 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< SnapshotArgsOnSnapshot
 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...
 

Detailed Description

The MyCaffeControl is the main object used to manage all training, testing and running of the MyCaffe system.

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

Definition at line 30 of file MyCaffeControl.cs.

Constructor & Destructor Documentation

◆ MyCaffeControl()

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.

Parameters
settingsSpecifies the setting used to configure the MyCaffeControl.
logSpecifies the Log for all output.
evtCancelSpecifies the CancelEvent used to abort training and testing operations.
evtSnapshotOptionally, specifies an auto reset event used to force a snap-shot.
evtForceTestOptionally, specifies an auto reset event used to force a test cycle.
evtPauseOptionally, specifies an auto reset event used to pause training.
rgGpuIdOptionally, specfies a set of GPU ID's that override those specified in the SettingsCaffe object.
strCudaPathOptionally, 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.
bCreateCudaDnnOptionally, specififies create the connection to CUDA (default = false, causing the creation to occur during Load).
ciOptionally, specifies the connection information used to connect to the dataset.

Definition at line 129 of file MyCaffeControl.cs.

Member Function Documentation

◆ AddCancelOverride()

void MyCaffe.MyCaffeControl< T >.AddCancelOverride ( CancelEvent  evtCancel)

Adds a cancel override.

Parameters
evtCancelSpecifies the new name of the cancel event to add.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 456 of file MyCaffeControl.cs.

◆ AddCancelOverrideByName()

void MyCaffe.MyCaffeControl< T >.AddCancelOverrideByName ( string  strEvtCancel)

Adds a cancel override.

Parameters
strEvtCancelSpecifies the new name of the cancel event to add.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 447 of file MyCaffeControl.cs.

◆ ApplyUpdate()

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.

Parameters
nIterationSpecifies the current iteration.
Returns
The learning rate used is returned.

Definition at line 340 of file MyCaffeControl.cs.

◆ Clone()

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.

Parameters
nGpuIDSpecifies the GPUID on which to load the second instance.
Returns
The new MyCaffeControl instance is returned.

Definition at line 266 of file MyCaffeControl.cs.

◆ CopyGradientsFrom()

void MyCaffe.MyCaffeControl< T >.CopyGradientsFrom ( MyCaffeControl< T >  src)

Copy the learnable parameter diffs from the source MyCaffeControl into this one.

Parameters
srcSpecifies the source MyCaffeControl whos gradients (blob diffs) are to be copied.

Definition at line 298 of file MyCaffeControl.cs.

◆ CopyWeightsFrom()

void MyCaffe.MyCaffeControl< T >.CopyWeightsFrom ( MyCaffeControl< T >  src)

Copy the learnable parameter data from the source MyCaffeControl into this one.

Parameters
srcSpecifies the source MyCaffeControl whos gradients (blob data) are to be copied.

Definition at line 318 of file MyCaffeControl.cs.

◆ CreateBlob()

Blob<T> MyCaffe.MyCaffeControl< T >.CreateBlob ( string  strName)

Create an unsized blob and set its name.

Parameters
strNameSpecifies the Blob name.
Returns
The Blob is returned.

Definition at line 2500 of file MyCaffeControl.cs.

◆ CreateDataBlob()

Blob<T> MyCaffe.MyCaffeControl< T >.CreateDataBlob ( SimpleDatum  d,
Blob< T >  blob = null 
)

Create a data blob from a SimpleDatum by transforming the data and placing the results in the blob returned.

Parameters
dSpecifies the datum to load into the blob.
blobOptionally, specifies a blob to use instead of creating a new one.
Returns
The data blob containing the transformed data is returned.

Implements MyCaffe.common.IXMyCaffeNoDb< T >.

Definition at line 1926 of file MyCaffeControl.cs.

◆ CreateExtension()

long MyCaffe.MyCaffeControl< T >.CreateExtension ( string  strExtensionDLLPath)

Create and load a new extension DLL.

Parameters
strExtensionDLLPathSpecifies the path to the extension DLL.
Returns
The handle to the extension is returned.

Implements MyCaffe.common.IXMyCaffeExtension< T >.

Definition at line 2512 of file MyCaffeControl.cs.

◆ createNetParameterForRunning() [1/4]

NetParameter MyCaffe.MyCaffeControl< T >.createNetParameterForRunning ( ProjectEx  p,
out TransformationParameter  transform_param 
)
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.

Parameters
pSpecifies a project.
transform_paramSpecifies the TransformationParameter to use.
Returns
The new NetParameter suitable for the RUN phase is returned.

Definition at line 725 of file MyCaffeControl.cs.

◆ createNetParameterForRunning() [2/4]

NetParameter MyCaffe.MyCaffeControl< T >.createNetParameterForRunning ( DatasetDescriptor  ds,
string  strModel,
out TransformationParameter  transform_param,
Stage  stage = Stage.NONE 
)
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.

Parameters
dsSpecifies a DatasetDescriptor for the dataset used.
strModelSpecifies the model descriptor.
transform_paramSpecifies the TransformationParameter to use.
stageOptionally, specifies the stage to create the run network on.
Returns
The new NetParameter suitable for the RUN phase is returned.

Definition at line 741 of file MyCaffeControl.cs.

◆ createNetParameterForRunning() [3/4]

NetParameter MyCaffe.MyCaffeControl< T >.createNetParameterForRunning ( BlobShape  shape,
string  strModel,
out TransformationParameter  transform_param,
Stage  stage = Stage.NONE 
)
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.

Parameters
shapeSpecifies the shape of the images that will be used.
strModelSpecifies the model descriptor.
transform_paramSpecifies the TransformationParameter to use.
stageOptionally, specifies the stage to create the run network on.
Returns
The new NetParameter suitable for the RUN phase is returned.

Definition at line 758 of file MyCaffeControl.cs.

◆ createNetParameterForRunning() [4/4]

NetParameter MyCaffe.MyCaffeControl< T >.createNetParameterForRunning ( SimpleDatum  sdMean,
string  strModel,
out TransformationParameter  transform_param,
out int  nC,
out int  nH,
out int  nW,
Stage  stage = Stage.NONE 
)
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.

Parameters
sdMeanSpecifies the mean image data used to size the network and as the mean image when used in the transformation parameter.
strModelSpecifies the model descriptor.
transform_paramReturns the TransformationParameter to use.
nCReturns the discovered channel sizing to use.
nHReturns the discovered height sizing to use.
nWReturns the discovered width sizing to use.
stageOptionally, specifies the stage to create the run network on.
Returns
The new NetParameter suitable for the RUN phase is returned.

Definition at line 779 of file MyCaffeControl.cs.

◆ CreateNetParameterForRunning()

static NetParameter MyCaffe.MyCaffeControl< T >.CreateNetParameterForRunning ( BlobShape  shape,
string  strModel,
out TransformationParameter  transform_param,
Stage  stage = Stage.NONE 
)
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.

Parameters
shapeSpecifies the shape of the images that will be used.
strModelSpecifies the model descriptor.
transform_paramSpecifies the TransformationParameter to use.
stageOptionally, specifies the stage to create the run network on.
Returns
The new NetParameter suitable for the RUN phase is returned.

Definition at line 840 of file MyCaffeControl.cs.

◆ dispose()

void MyCaffe.MyCaffeControl< T >.dispose ( )

Releases all GPU and Host resources used by the CaffeControl.

Definition at line 184 of file MyCaffeControl.cs.

◆ FreeExtension()

void MyCaffe.MyCaffeControl< T >.FreeExtension ( long  hExtension)

Free an existing extension and unload it.

Parameters
hExtensionSpecifies the handle to the extension to free.

Implements MyCaffe.common.IXMyCaffeExtension< T >.

Definition at line 2521 of file MyCaffeControl.cs.

◆ GetDataset()

Returns the current dataset used when training and testing.

Returns
The DatasetDescriptor is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2246 of file MyCaffeControl.cs.

◆ GetDeviceCount()

int MyCaffe.MyCaffeControl< T >.GetDeviceCount ( )

Returns the total number of devices installed on this computer.

Returns

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 693 of file MyCaffeControl.cs.

◆ GetDeviceName()

string MyCaffe.MyCaffeControl< T >.GetDeviceName ( int  nDeviceID)

Returns the device name of a given device ID.

Parameters
nDeviceIDSpecifies the device ID.
Returns

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 703 of file MyCaffeControl.cs.

◆ GetImageMean()

SimpleDatum MyCaffe.MyCaffeControl< T >.GetImageMean ( )

Returns the image mean used by the solver network used during training.

Returns
The image mean is returned as a SimpleDatum.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2225 of file MyCaffeControl.cs.

◆ GetInternalNet()

Net<T> MyCaffe.MyCaffeControl< T >.GetInternalNet ( Phase  phase = Phase.RUN)

Returns the internal net based on the Phase specified: TRAIN, TEST or RUN.

Parameters
phaseSpecifies the Phase used to select the Net.
Returns
The internal Net is returned.

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 2332 of file MyCaffeControl.cs.

◆ GetInternalSolver()

Solver<T> MyCaffe.MyCaffeControl< T >.GetInternalSolver ( )

Get the internal solver.

Returns

Definition at line 2353 of file MyCaffeControl.cs.

◆ GetLicenseText()

string MyCaffe.MyCaffeControl< T >.GetLicenseText ( string  strOtherLicenses)

Returns the license text for MyCaffe.

Parameters
strOtherLicensesSpecifies other licenses to append to the license text.
Returns

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2405 of file MyCaffeControl.cs.

◆ GetLicenseTextEx()

static string MyCaffe.MyCaffeControl< T >.GetLicenseTextEx ( string  strOtherLicenses)
static

Returns the license text for MyCaffe.

Parameters
strOtherLicensesSpecifies other licenses to append to the license text.
Returns

Definition at line 2384 of file MyCaffeControl.cs.

◆ GetNet()

Net<T> MyCaffe.MyCaffeControl< T >.GetNet ( byte []  rgWeights,
CudaDnn< T >  cudaOverride = null 
)

Creates a new Net, loads the weights specified into it and returns it.

Parameters
rgWeightsSpecifies the weights to load.
cudaOverrideOptionally, specifies a different cuda instance for the Net to use.
Returns
The new Net is returned.

Definition at line 2308 of file MyCaffeControl.cs.

◆ GetTargetImage() [1/2]

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.

Parameters
nSrcIdSpecifies the Source ID.
nIdxSpecifies the image index.
nLabelReturns the expected label for the image.
strLabelReturns the expected label name for the image.
rgCriteriaReturns the data criteria if one exists.
fmtCriteriaReturns the format of the data criteria, if one exists.
Returns
The image queried is returned.

Definition at line 2178 of file MyCaffeControl.cs.

◆ GetTargetImage() [2/2]

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.

Parameters
nImageIDSpecifies the Raw Image ID.
nLabelReturns the expected label for the image.
strLabelReturns the expected label name for the image.
rgCriteriaReturns the data criteria if one exists.
fmtCriteriaReturns the format of the data criteria, if one exists.
Returns
The image queried is returned.

Definition at line 2205 of file MyCaffeControl.cs.

◆ GetTestImage() [1/2]

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.

Parameters
phaseSpecifies whether to select images from the training set or testing set.
nLabelReturns the expected label for the image.
strLabelReturns the expected label name for the image.
Returns
The image queried is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2138 of file MyCaffeControl.cs.

◆ GetTestImage() [2/2]

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.

Parameters
phaseSpecifies whether to select images from the training set or testing set.
nLabelReturns the expected label for the image.
Returns
The image queried is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2159 of file MyCaffeControl.cs.

◆ GetWeights()

byte [] MyCaffe.MyCaffeControl< T >.GetWeights ( )

Retrieves the weights of the training network.

Returns
The weights are returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2255 of file MyCaffeControl.cs.

◆ Load() [1/2]

bool MyCaffe.MyCaffeControl< T >.Load ( Phase  phase,
ProjectEx  p,
IMGDB_LABEL_SELECTION_METHOD labelSelectionOverride = null,
IMGDB_IMAGE_SELECTION_METHOD imageSelectionOverride = null,
bool  bResetFirst = false,
IXImageDatabaseBase  imgdb = null,
bool  bUseImageDb = true,
bool  bCreateRunNet = true,
string  strStage = null,
bool  bEnableMemTrace = false 
)

Load a project and optionally the MyCaffeImageDatabase.

This load function uses the MyCaffeImageDatabase.

Parameters
phaseSpecifies the Phase for which the load should focus.
pSpecifies the Project to load.
labelSelectionOverrideOptionally, specifies the label selection override (overides the label selection in SettingsCaffe). The label selection dictates how the label sets are selected.
imageSelectionOverrideOptionally, specifies the image selection override (overides the image selection in SettingsCaffe). The image selection dictates how the images are selected from each label set.
bResetFirstOptionally, 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.
imgdbOptionally, specifies the MyCaffeImageDatabase to use. When null, an instance if the MyCaffeImageDatabase is created internally.
bUseImageDbOptionally, specifies whehter or not to use the image database (default = true).
bCreateRunNetOptionally, specifies whether or not to create the Run net.
strStageOptionally, specifies a stage under which to load the model.
bEnableMemTraceOptionally, specifies to enable the memory tracing (only available in debug builds).
Returns
If the project is loaded the function returns true, otherwise false is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 954 of file MyCaffeControl.cs.

◆ Load() [2/2]

bool MyCaffe.MyCaffeControl< T >.Load ( Phase  phase,
string  strSolver,
string  strModel,
byte []  rgWeights,
IMGDB_LABEL_SELECTION_METHOD labelSelectionOverride = null,
IMGDB_IMAGE_SELECTION_METHOD imageSelectionOverride = null,
bool  bResetFirst = false,
IXImageDatabaseBase  imgdb = null,
bool  bUseImageDb = true,
bool  bCreateRunNet = true,
string  strStage = null,
bool  bEnableMemTrace = false 
)

Load a project and optionally the MyCaffeImageDatabase.

This load function uses the MyCaffeImageDatabase.

Parameters
phaseSpecifies the Phase for which the load should focus.
strSolverSpecifies the solver descriptor.
strModelSpecifies the model desciptor.
rgWeightsOptionally, specifies the weights to load, or null to ignore.
labelSelectionOverrideOptionally, specifies the label selection override (overides the label selection in SettingsCaffe). The label selection dictates how the label sets are selected.
imageSelectionOverrideOptionally, specifies the image selection override (overides the image selection in SettingsCaffe). The image selection dictates how the images are selected from each label set.
bResetFirstOptionally, 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.
imgdbOptionally, specifies the MyCaffeImageDatabase to use. When null, an instance if the MyCaffeImageDatabase is created internally.
bUseImageDbOptionally, specifies whehter or not to use the image database (default = true).
bCreateRunNetOptionally, specifies whether or not to create the Run net (default = true).
strStageOptionally, specifies a stage under which to load the model.
bEnableMemTraceOptionally, specifies to enable the memory tracing (only available in debug builds).
Returns
If the project is loaded the function returns true, otherwise false is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1144 of file MyCaffeControl.cs.

◆ LoadLite()

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.

Parameters
phaseSpecifies the Phase for which the load should focus.
strSolverSpecifies the solver descriptor.
strModelSpecifies the model desciptor.
rgWeightsOptionally, specifies the weights to load, or null to ignore (default = null).
bResetFirstOptionally, 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.
bCreateRunNetOptionally, specifies whether or not to create the Run net (default = true).
sdMeanOptionally, specifies the image mean to use (default = null).
strStageOptionally, specifies a stage under which to load the model.
bEnableMemTraceOptionally, specifies to enable the memory tracing (only available in debug builds).
Returns
If the project is loaded the function returns true, otherwise false is returned.

Definition at line 1322 of file MyCaffeControl.cs.

◆ LoadToRun()

void MyCaffe.MyCaffeControl< T >.LoadToRun ( string  strModel,
byte []  rgWeights,
BlobShape  shape,
SimpleDatum  sdMean = null,
TransformationParameter  transParam = null,
bool  bForceBackward = false 
)

The LoadToRun method loads the MyCaffeControl for running only (e.g. deployment).

This method does not use the MyCaffeImageDatabase.

Parameters
strModelSpecifies the model description to load.
rgWeightsSpecifies the trained weights to load.
shapeSpecifies the expected shape to run on.
sdMeanOptionally, specifies the simple datum mean to subtract from input images that are run.
transParamOptionally, 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.
bForceBackwardOptionally, 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.

Implements MyCaffe.common.IXMyCaffeNoDb< T >.

Definition at line 1436 of file MyCaffeControl.cs.

◆ PrepareImageMeans()

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.

Parameters
prjSpecifies the project whos image mean is to be prepared.

Definition at line 907 of file MyCaffeControl.cs.

◆ ReInitializeParameters()

bool MyCaffe.MyCaffeControl< T >.ReInitializeParameters ( 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.

Parameters
rgstrLayersSpecifies the layers to reinitialize, when null or empty, all layers are re-initialized
Returns
If a layer is specified and found, true is returned, otherwise false is returned.

This method causes the OnTrainingIteration event to fire with the updated values from the re-init.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 427 of file MyCaffeControl.cs.

◆ RemoveCancelOverride()

void MyCaffe.MyCaffeControl< T >.RemoveCancelOverride ( CancelEvent  evtCancel)

Remove a cancel override.

Parameters
evtCancelSpecifies the new name of the cancel event to remove.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 474 of file MyCaffeControl.cs.

◆ RemoveCancelOverrideByName()

void MyCaffe.MyCaffeControl< T >.RemoveCancelOverrideByName ( string  strEvtCancel)

Remove a cancel override.

Parameters
strEvtCancelSpecifies the new name of the cancel event to remove.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 465 of file MyCaffeControl.cs.

◆ ResetDevice()

static void MyCaffe.MyCaffeControl< T >.ResetDevice ( int  nDeviceID)
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.

Parameters
nDeviceIDSpecifies the device ID of the device to reset.

Definition at line 2375 of file MyCaffeControl.cs.

◆ Run() [1/6]

ResultCollection MyCaffe.MyCaffeControl< T >.Run ( int  nImageIdx)

Run on a given image in the MyCaffeImageDatabase based on its image index.

Parameters
nImageIdxSpecifies the image index.
Returns
The result of the run is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1894 of file MyCaffeControl.cs.

◆ Run() [2/6]

List<ResultCollection> MyCaffe.MyCaffeControl< T >.Run ( List< int >  rgImageIdx)

Run on a set of images in the MyCaffeImageDatabase based on their image indexes.

Parameters
rgImageIdxSpecifies a list of image indexes.
Returns
A list of results from the run is returned - one result per image.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1906 of file MyCaffeControl.cs.

◆ Run() [3/6]

ResultCollection MyCaffe.MyCaffeControl< T >.Run ( SimpleDatum  d,
bool  bSort,
bool  bUseSolverNet 
)

Run on a given Datum.

Parameters
dSpecifies the Datum to run.
bSortSpecifies whether or not to sor the results.
bUseSolverNetOptionally, specifies whether or not to use the training net vs. the run net.
Returns
The results of the run are returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1959 of file MyCaffeControl.cs.

◆ Run() [4/6]

List<ResultCollection> MyCaffe.MyCaffeControl< T >.Run ( List< SimpleDatum rgSd,
bool  bSort = true,
bool  bUseSolverNet = false 
)
protected

Run on a given list of Datum.

Parameters
rgSdSpecifies the list of Datum to run.
bSortOptionally, specifies whether or not to sor the results.
bUseSolverNetOptionally, specifies whether or not to use the training net vs. the run net.
Returns
A list of results of the run are returned.

Definition at line 2029 of file MyCaffeControl.cs.

◆ Run() [5/6]

ResultCollection MyCaffe.MyCaffeControl< T >.Run ( Bitmap  img,
bool  bSort = true 
)

Run on a given bitmap image.

This method does not use the MyCaffeImageDatabase.

Parameters
imgSpecifies the input image.
bSortSpecifies whether or not to sort the results.
Returns
The results of the run are returned.

Implements MyCaffe.common.IXMyCaffeNoDb< T >.

Definition at line 2107 of file MyCaffeControl.cs.

◆ Run() [6/6]

ResultCollection MyCaffe.MyCaffeControl< T >.Run ( SimpleDatum  d,
bool  bSort = true 
)

Run on a given Datum.

Parameters
dSpecifies the Datum to run.
bSortSpecifies whether or not to sort the results.
Returns
The results of the run are returned.

Implements MyCaffe.common.IXMyCaffeNoDb< T >.

Definition at line 2126 of file MyCaffeControl.cs.

◆ RunExtension()

T [] MyCaffe.MyCaffeControl< T >.RunExtension ( long  hExtension,
long  lfnIdx,
T []  rgParam 
)

Run a function on an existing extension.

Parameters
hExtensionSpecifies the extension.
lfnIdxSpecifies the function to run on the extension.
rgParamSpecifies the parameters.
Returns
The return values of the function are returned.

Implements MyCaffe.common.IXMyCaffeExtension< T >.

Definition at line 2532 of file MyCaffeControl.cs.

◆ RunExtensionD()

double [] MyCaffe.MyCaffeControl< T >.RunExtensionD ( long  hExtension,
long  lfnIdx,
double []  rgParam 
)

Run a function on an existing extension using the double base type.

Parameters
hExtensionSpecifies the extension.
lfnIdxSpecifies the function to run on the extension.
rgParamSpecifies the parameters.
Returns
The return values of the function are returned.

Implements MyCaffe.common.IXMyCaffeExtension< T >.

Definition at line 2543 of file MyCaffeControl.cs.

◆ RunExtensionF()

float [] MyCaffe.MyCaffeControl< T >.RunExtensionF ( long  hExtension,
long  lfnIdx,
float []  rgParam 
)

Run a function on an existing extension using the float base type.

Parameters
hExtensionSpecifies the extension.
lfnIdxSpecifies the function to run on the extension.
rgParamSpecifies the parameters.
Returns
The return values of the function are returned.

Implements MyCaffe.common.IXMyCaffeExtension< T >.

Definition at line 2560 of file MyCaffeControl.cs.

◆ SetOnTestOverride()

void MyCaffe.MyCaffeControl< T >.SetOnTestOverride ( EventHandler< TestArgs onTest)

Sets the root solver's onTest event function.

Parameters
onTestSpecifies the event handler called when testing.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 438 of file MyCaffeControl.cs.

◆ Snapshot()

void MyCaffe.MyCaffeControl< T >.Snapshot ( bool  bUpdateDatabase = true)

The Snapshot function forces a snapshot to occur.

Parameters
bUpdateDatabaseOptionally, specifies to update the database (default = true).

Definition at line 2362 of file MyCaffeControl.cs.

◆ Test()

double MyCaffe.MyCaffeControl< T >.Test ( int  nIterationOverride = -1)

Test the network a given number of iterations.

Parameters
nIterationOverrideOptionally, specifies number of iterations to run that override the iterations specified in the solver desctiptor.
Returns
The accuracy value from the test is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1673 of file MyCaffeControl.cs.

◆ TestMany()

List<Tuple<SimpleDatum, ResultCollection> > MyCaffe.MyCaffeControl< T >.TestMany ( int  nCount,
bool  bOnTrainingSet,
bool  bOnTargetSet = false,
IMGDB_IMAGE_SELECTION_METHOD  imgSelMethod = IMGDB_IMAGE_SELECTION_METHOD.RANDOM,
int  nImageStartIdx = 0 
)

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.

Parameters
nCountSpecifies the number of cycles to run.
bOnTrainingSetSpecifies on whether to select images from the training set, or when false the testing set of data.
bOnTargetSetOptionally, 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.
imgSelMethodOptionally, specifies the image selection method (default = RANDOM).
nImageStartIdxOptionally, specifies the image start index (default = 0).
Returns
The list of SimpleDatum and their ResultCollections (after running the model on each) is returned.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 1695 of file MyCaffeControl.cs.

◆ Train()

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.

Parameters
nIterationOverrideOptionally, specifies number of iterations to run that override the iterations specified in the solver desctiptor.
nTrainingTimeLimitInMinutesOptionally, specifies a maximum number of minutes to train. When set to 0, this parameter is ignored and no time limit is imposed.
stepOptionally, 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.
dfLearningRateOverrideOptionally, specifies a learning rate override (default = 0 which ignores this parameter)
bResetOptionally, 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 1607 of file MyCaffeControl.cs.

◆ Unload()

void MyCaffe.MyCaffeControl< T >.Unload ( bool  bUnloadImageDb = true,
bool  bIgnoreExceptions = false 
)

Unload the currently loaded project, if any.

Parameters
bUnloadImageDbOptionally, specifies to unload the image database (default = true).
bIgnoreExceptionsOptionally, specifies to ignore exceptions on error (default = false).

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 368 of file MyCaffeControl.cs.

◆ UpdateRunWeights()

void MyCaffe.MyCaffeControl< T >.UpdateRunWeights ( )

Loads the weights from the training net into the Net used for running.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2271 of file MyCaffeControl.cs.

◆ UpdateWeights()

void MyCaffe.MyCaffeControl< T >.UpdateWeights ( byte []  rgWeights)

Loads the training Net with new weights.

Parameters
rgWeightsSpecifies the weights to load.

Implements MyCaffe.common.IXMyCaffe< T >.

Definition at line 2281 of file MyCaffeControl.cs.

◆ VerifyCompute()

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.

Parameters
strExtraOptionally, specifies extra information for the exception if one is thrown.
nDeviceIDOptionally, specifies a specific device ID to check, otherwise uses the current device used (default = -1, which uses the current device).
bThrowExceptionOptionally, specifies whether or not to throw an exception on a compute mis-match (default = true).
Returns
If the device's compute is >= to the required compute fo the CudaDnnDll.dll used, true is returned, otherwise false is returned.

Implements MyCaffe.common.IXMyCaffeState< T >.

Definition at line 2417 of file MyCaffeControl.cs.

Member Data Documentation

◆ m_bImgDbOwner

bool MyCaffe.MyCaffeControl< T >.m_bImgDbOwner = true
protected

Whether or not the control owns the image database.

Definition at line 47 of file MyCaffeControl.cs.

◆ m_dataSet

DatasetDescriptor MyCaffe.MyCaffeControl< T >.m_dataSet = null
protected

The dataset descriptor of the dataset used in the image database.

Definition at line 75 of file MyCaffeControl.cs.

◆ m_dataTransformer

DataTransformer<T> MyCaffe.MyCaffeControl< T >.m_dataTransformer = null
protected

The data transformer used to transform data.

Definition at line 67 of file MyCaffeControl.cs.

◆ m_evtCancel

CancelEvent MyCaffe.MyCaffeControl< T >.m_evtCancel
protected

The CancelEvent used to cancel training and testing operations.

Definition at line 51 of file MyCaffeControl.cs.

◆ m_evtForceSnapshot

AutoResetEvent MyCaffe.MyCaffeControl< T >.m_evtForceSnapshot
protected

An auto-reset event used to force a snapshot.

Definition at line 55 of file MyCaffeControl.cs.

◆ m_evtForceTest

AutoResetEvent MyCaffe.MyCaffeControl< T >.m_evtForceTest
protected

An auto-reset event used to force a test cycle.

Definition at line 59 of file MyCaffeControl.cs.

◆ m_evtPause

ManualResetEvent MyCaffe.MyCaffeControl< T >.m_evtPause
protected

An auto-reset event used to pause training.

Definition at line 63 of file MyCaffeControl.cs.

◆ m_imgDb

IXImageDatabaseBase MyCaffe.MyCaffeControl< T >.m_imgDb = null
protected

The image database.

Definition at line 43 of file MyCaffeControl.cs.

◆ m_log

Log MyCaffe.MyCaffeControl< T >.m_log
protected

The log used for output.

Definition at line 39 of file MyCaffeControl.cs.

◆ m_project

ProjectEx MyCaffe.MyCaffeControl< T >.m_project = null
protected

The active project (if any).

Definition at line 71 of file MyCaffeControl.cs.

◆ m_rgGpu

List<int> MyCaffe.MyCaffeControl< T >.m_rgGpu
protected

A list of the Device ID's used for training.

Definition at line 83 of file MyCaffeControl.cs.

◆ m_settings

SettingsCaffe MyCaffe.MyCaffeControl< T >.m_settings
protected

The settings used to configure the control.

Definition at line 35 of file MyCaffeControl.cs.

◆ m_strCudaPath

string MyCaffe.MyCaffeControl< T >.m_strCudaPath = null
protected

The low-level path of the underlying CudaDnn DLL.

Definition at line 79 of file MyCaffeControl.cs.

Property Documentation

◆ ActiveGpus

List<int> MyCaffe.MyCaffeControl< T >.ActiveGpus
get

Returns a list of Active GPU's used by the control.

Definition at line 616 of file MyCaffeControl.cs.

◆ ActiveLabelCounts

string MyCaffe.MyCaffeControl< T >.ActiveLabelCounts
get

Returns a string describing the active label counts observed during training.

This string can help diagnose label balancing issue.

Definition at line 627 of file MyCaffeControl.cs.

◆ CancelEvent

Returns the CancelEvent used.

Definition at line 608 of file MyCaffeControl.cs.

◆ Cuda

CudaDnn<T> MyCaffe.MyCaffeControl< T >.Cuda
get

Returns the CudaDnn connection used.

Definition at line 576 of file MyCaffeControl.cs.

◆ CurrentDevice

string MyCaffe.MyCaffeControl< T >.CurrentDevice
get

Returns the name of the current device used.

Definition at line 657 of file MyCaffeControl.cs.

◆ CurrentIteration

int MyCaffe.MyCaffeControl< T >.CurrentIteration
get

Returns the current iteration.

Definition at line 677 of file MyCaffeControl.cs.

◆ CurrentProject

ProjectEx MyCaffe.MyCaffeControl< T >.CurrentProject
get

Returns the name of the currently loaded project.

Definition at line 669 of file MyCaffeControl.cs.

◆ CurrentStage

string MyCaffe.MyCaffeControl< T >.CurrentStage
get

Returns the stage under which the project was loaded, if any.

Definition at line 254 of file MyCaffeControl.cs.

◆ DatasetConnectInfo

ConnectInfo MyCaffe.MyCaffeControl< T >.DatasetConnectInfo
get

Returns the dataset connection information, if used (default = null).

Definition at line 246 of file MyCaffeControl.cs.

◆ DataTransformer

Returns the DataTransormer used.

Definition at line 560 of file MyCaffeControl.cs.

◆ EnableBlobDebugging

bool MyCaffe.MyCaffeControl< T >.EnableBlobDebugging
getset

Enable/disable blob debugging.

Note, when enabled, training will dramatically slow down.

Definition at line 486 of file MyCaffeControl.cs.

◆ EnableBreakOnFirstNaN

bool MyCaffe.MyCaffeControl< T >.EnableBreakOnFirstNaN
getset

Enable/disable break training after first detecting a NaN.

This option requires that EnableBlobDebugging == true.

Definition at line 502 of file MyCaffeControl.cs.

◆ EnableDetailedNanDetection

bool MyCaffe.MyCaffeControl< T >.EnableDetailedNanDetection
getset

When enabled (requires EnableBlobDebugging = true), the detailed Nan (and Infinity) detection is perofmed on each blob when training Net.

Definition at line 515 of file MyCaffeControl.cs.

◆ EnableLayerDebugging

bool MyCaffe.MyCaffeControl< T >.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.

This option dramatically slows down training and is only recommended during debugging.

Definition at line 531 of file MyCaffeControl.cs.

◆ EnableSingleStep

bool MyCaffe.MyCaffeControl< T >.EnableSingleStep
getset

Enable/disable single step training.

This option requires that EnableBlobDebugging == true.

Definition at line 547 of file MyCaffeControl.cs.

◆ EnableTesting

bool MyCaffe.MyCaffeControl< T >.EnableTesting
getset

Enable/disable testing. For example reinforcement learning does not use testing.

Definition at line 349 of file MyCaffeControl.cs.

◆ EnableVerboseStatus

bool MyCaffe.MyCaffeControl< T >.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).

Definition at line 358 of file MyCaffeControl.cs.

◆ ImageDatabase

Returns the MyCaffeImageDatabase used.

Definition at line 600 of file MyCaffeControl.cs.

◆ LabelQueryEpochs

string MyCaffe.MyCaffeControl< T >.LabelQueryEpochs
get

Returns a string describing the label query epochs observed during training.

This string can help diagnose label balancing issue.

Definition at line 649 of file MyCaffeControl.cs.

◆ LabelQueryHitPercents

string MyCaffe.MyCaffeControl< T >.LabelQueryHitPercents
get

Returns a string describing the label query hit percentages observed during training.

This string can help diagnose label balancing issue.

Definition at line 638 of file MyCaffeControl.cs.

◆ LastPhase

Phase MyCaffe.MyCaffeControl< T >.LastPhase
get

Returns the last phase run (TRAIN, TEST or RUN).

Definition at line 712 of file MyCaffeControl.cs.

◆ Log

Returns the Log (for output) used.

Definition at line 584 of file MyCaffeControl.cs.

◆ MaximumIteration

int MyCaffe.MyCaffeControl< T >.MaximumIteration
get

Returns the maximum iteration.

Definition at line 685 of file MyCaffeControl.cs.

◆ Persist

IXPersist<T> MyCaffe.MyCaffeControl< T >.Persist
get

Returns the persist used to load and save weights.

Definition at line 592 of file MyCaffeControl.cs.

◆ Settings

Returns the settings used to create the control.

Definition at line 568 of file MyCaffeControl.cs.

Event Documentation

◆ OnSnapshot

EventHandler<SnapshotArgs> MyCaffe.MyCaffeControl< T >.OnSnapshot

The OnSnapshot event fires each time a snap-shot is taken.

Definition at line 106 of file MyCaffeControl.cs.

◆ OnTestingIteration

EventHandler<TestingIterationArgs<T> > MyCaffe.MyCaffeControl< T >.OnTestingIteration

The OnTestingIteration event fires at the end of each testing iteration.

Definition at line 114 of file MyCaffeControl.cs.

◆ OnTrainingIteration

EventHandler<TrainingIterationArgs<T> > MyCaffe.MyCaffeControl< T >.OnTrainingIteration

The OnTrainingIteration event fires at the end of each training iteration.

Definition at line 110 of file MyCaffeControl.cs.


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