MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.IXMyCaffe< T > Interface Template Reference

The IXMyCaffe interface contains functions used to perform MyCaffe operations that work with the MyCaffeImageDatabase. More...

Inheritance diagram for MyCaffe.common.IXMyCaffe< T >:
MyCaffe.MyCaffeControl< T >

Public Member Functions

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...
 
void Unload (bool bUnloadDb=true, bool bIgnoreExceptions=false)
 Unload the currently loaded project. 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 and allow for single stepping. More...
 
double Test (int nIterationOverride=-1)
 Test the network a given number of iterations. More...
 
PropertySet TestMany (PropertySet customInput)
 Runs test many on a set of 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< ResultCollectionRun (List< int > rgImageIdx)
 Run on a set of images in the MyCaffeImageDatabase based on their image indexes. More...
 
ResultCollection Run (SimpleDatum d, bool bSort=true, bool bUseSolverNet=false)
 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...
 
SimpleDatum GetItemMean ()
 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 (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...
 
string GetLicenseText (string strOtherLicenses)
 Returns the license text for MyCaffe. More...
 

Detailed Description

The IXMyCaffe interface contains functions used to perform MyCaffe operations that work with the MyCaffeImageDatabase.

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

Definition at line 409 of file Interfaces.cs.

Member Function Documentation

◆ GetDataset()

Returns the current dataset used when training and testing.

Returns
The DatasetDescriptor is returned.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ GetItemMean()

SimpleDatum MyCaffe.common.IXMyCaffe< T >.GetItemMean ( )

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

Returns
The image mean is returned as a SimpleDatum.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ GetLicenseText()

string MyCaffe.common.IXMyCaffe< T >.GetLicenseText ( string  strOtherLicenses)

Returns the license text for MyCaffe.

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

Implemented in MyCaffe.MyCaffeControl< T >.

◆ GetTestImage() [1/2]

Bitmap MyCaffe.common.IXMyCaffe< 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ GetTestImage() [2/2]

Bitmap MyCaffe.common.IXMyCaffe< 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ GetWeights()

byte[] MyCaffe.common.IXMyCaffe< T >.GetWeights ( )

Retrieves the weights of the training network.

Returns
The weights are returned.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Load() [1/2]

bool MyCaffe.common.IXMyCaffe< 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.

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.
itemSelectionOverrideOptionally, 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.
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.
dbOptionally, specifies the in-memory MyCaffeDatabase to use. When null, an instance if the in-memory MyCaffeDatabase is created internally based on the 'dbVer'.
bUseDbOptionally, specifies to use the in-memory database if not null.
bCreateRunNetOptionally, specifies whether or not to create the Run net.
strStageOptionally, specifies the 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Load() [2/2]

bool MyCaffe.common.IXMyCaffe< 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.

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.
itemSelectionOverrideOptionally, 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.
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.
dbOptionally, specifies the in-memory MyCaffeDatabase to use. When null, an instance if the in-memory MyCaffeDatabase is created internally based on the 'dbVer'.
bUseDbOptionally, specifies to use the in-memory database if not null.
bCreateRunNetOptionally, specifies whether or not to create the Run net.
strStageOptionally, specifies the 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Run() [1/3]

ResultCollection MyCaffe.common.IXMyCaffe< T >.Run ( int  nImageIdx,
bool  bPad = true 
)

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

Parameters
nImageIdxSpecifies the image index.
bPadOptionally, pad with an extra image (default = true).
Returns
The result of the run is returned.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Run() [2/3]

List< ResultCollection > MyCaffe.common.IXMyCaffe< 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Run() [3/3]

ResultCollection MyCaffe.common.IXMyCaffe< T >.Run ( SimpleDatum  d,
bool  bSort = true,
bool  bUseSolverNet = false 
)

Run on a given Datum.

Parameters
dSpecifies the 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
The results of the run are returned.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Test()

double MyCaffe.common.IXMyCaffe< 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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ TestMany() [1/2]

List< Tuple< SimpleDatum, ResultCollection > > MyCaffe.common.IXMyCaffe< 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.

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.
imgSelMethodOptionally, specifies the image selection method (default = RANDOM).
nImageStartIdxOptionally, specifies the image start index (default = 0).
dtImageStartTimeOptionally, specifies the image start time (default = null). Note either the 'nImageStartIdx' or 'dtImageStartTime' may be used, but not both.
dfThresholdOptionally, specifies a threshold where the winning selection must also be above the threshold in score.
Returns
The list of SimpleDatum and their ResultCollections (after running the model on each) is returned.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ TestMany() [2/2]

PropertySet MyCaffe.common.IXMyCaffe< T >.TestMany ( PropertySet  customInput)

Runs test many on a set of custom input data.

Parameters
customInputSpecifies the custom input data, each separated by ';'.
Returns
A property set is returned with the results.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Train()

void MyCaffe.common.IXMyCaffe< 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 and allow for single stepping.

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.

Implemented in MyCaffe.MyCaffeControl< T >.

◆ Unload()

void MyCaffe.common.IXMyCaffe< T >.Unload ( bool  bUnloadDb = true,
bool  bIgnoreExceptions = false 
)

Unload the currently loaded project.

Parameters
bUnloadDbOptionally, specifies whether or not to unload the in-memory database. The default = true.
bIgnoreExceptionsOptionally, specifies to ignore exceptions that occur (default = false).

Implemented in MyCaffe.MyCaffeControl< T >.

◆ UpdateRunWeights()

void MyCaffe.common.IXMyCaffe< T >.UpdateRunWeights ( bool  bOutputStatus = false,
bool  bVerifyWeights = true 
)

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

Parameters
bOutputStatusOptionally, specifies whether or not the status is output as the weights are updated (default = false).
bVerifyWeightsOptionally, specifies to verify the updated weights (default = true).

Implemented in MyCaffe.MyCaffeControl< T >.

◆ UpdateWeights()

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

Loads the training Net with new weights.

Parameters
rgWeightsSpecifies the weights to load.

Implemented in MyCaffe.MyCaffeControl< T >.


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