MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The ProjectEx class manages a project containing the solver description, model description, data set (with training data source and testing data source) and project results. More...
Public Member Functions | |
ProjectEx (string strName, string strDsName=null) | |
The ProjectEx constructor. More... | |
ProjectEx (ProjectDescriptor prj, StateDescriptor state=null, bool bExistTrain=false, bool bExistTest=false, bool bQueryModel=true, bool bQuerySolver=true) | |
The ProjectEx constructor. More... | |
bool | RequiresDataCriteria () |
Returns whether or not the data criteria is required by the current project model (e.g. the model contains an AnnotatedData layer). More... | |
string | GetCustomTrainer (out string strProperties) |
Returns the custom trainer and properties used by the project (if any). More... | |
int | GetBatchSize (Phase phase) |
Returns the batch size of the project used in a given Phase. More... | |
double? | GetLayerSetting (Phase phase, string strLayer, string strParam) |
Returns the setting of a Layer (if found). More... | |
string | GetLayerSettingEx (Phase phase, string strLayer, string strParam) |
Returns the setting of a Layer (if found). More... | |
string | GetSolverSetting (string strParam) |
Get a setting from the solver descriptor. More... | |
double? | GetSolverSettingAsNumeric (string strParam) |
Get a setting from the solver descriptor as a double value. More... | |
int? | GetSolverSettingAsInt (string strParam) |
Get a setting from the solver descriptor as an integer value. More... | |
bool? | GetSolverSettingAsBool (string strParam) |
Get a setting from the solver descriptor as a boolean value. More... | |
bool | SetSolverVariable (string strVar, string strVal) |
Set a given Solver variable in the solver description script. More... | |
void | LoadSolverFile (string strFile) |
Load the solver description from a file. More... | |
void | LoadModelFile (string strFile) |
Load the model description from a file. More... | |
RawProto | CreateModelForRunning (string strName, int nNum, int nChannels, int nHeight, int nWidth, out RawProto protoTransform, out bool bSkipTransformParam, Stage stage=Stage.NONE, bool bSkipLossLayer=false) |
Create a model description as a RawProto for running the Project. More... | |
void | SetDataset (DatasetDescriptor dataset) |
Sets the dataset used by the Project, overriding the current dataset used. More... | |
bool | DisableTesting () |
Disables the testing interval so that no test passes are run. More... | |
override string | ToString () |
Returns a string representation of the Project. More... | |
Static Public Member Functions | |
static RawProto | CreateModelForTraining (string strModelDescription, string strName, bool bCaffeFormat=false) |
Create a model description as a RawProto for training the Project. More... | |
static RawProto | CreateModelForRunning (string strModelDescription, string strName, int nNum, int nChannels, int nHeight, int nWidth, out RawProto protoTransform, out bool bSkipTransformParam, Stage stage=Stage.NONE, bool bSkipLossLayer=false) |
Create a model description as a RawProto for running the Project. More... | |
static string | SetDataset (string strModelDesc, DatasetDescriptor dataset, out bool bResized, bool bUpdateOutputs=false) |
Sets the dataset of a model, overriding the current dataset used. More... | |
static string | FindLayerParameter (string strModelDescription, string strLayerName, string strLayerType, string strParam, string strField, Phase phaseMatch=Phase.NONE) |
This method searches for a given parameter within a given layer, optionally for a certain Phase. More... | |
Properties | |
bool | DatasetAdjusted [getset] |
Get/set whether or not the dataset for the project has been changed. More... | |
SettingsCaffe | Settings [getset] |
Get/set the Caffe setting to use with the Project. More... | |
string | Name [getset] |
Get/set the name of the Project. More... | |
int | ID [get] |
Returns the ID of the Project in the database. More... | |
int | OriginalID [getset] |
Get/set the original project ID. More... | |
string | Owner [getset] |
Get/set the ID of the Project owner. More... | |
bool | Active [get] |
Returns whether or not the Project is active. More... | |
TRAINING_CATEGORY | TrainingCategory [get] |
Returns the training category of the project, or NONE if no custom trainer is used. More... | |
Stage | Stage [getset] |
Return the stage under which the project was opened. More... | |
double | SuperBoostProbability [getset] |
Get/set the super boost probability used by the Project. More... | |
bool | UseTrainingSourceForTesting [get] |
Returns whether or not the Project uses the training data source when testing (default = false). More... | |
bool | EnableLabelBalancing [get] |
Returns whether or not label balancing is enabled. When enabled, first the label set is randomly selected and then the image is selected from the label set using the image selection criteria (e.g. Random). More... | |
bool | EnableLabelBoosting [get] |
Returns whether or not label boosting is enabled. When using Label boosting, images are selected from boosted labels with a higher probability that images from other label sets. More... | |
bool | EnableRandomSelection [get] |
Returns whether or not random image selection is enabled. When enabled, images are randomly selected from the entire set, or randomly from a label set when label balancing is in effect. More... | |
bool | EnablePairSelection [get] |
Returns whether or not pair selection is enabled. When using pair selection, images are queried in pairs where the first query selects the image based on the image selection criteria (e.g. Random), and then the second image query returns the image just following the first image in the database. More... | |
string | GpuOverride [get] |
Returns the list of comma separated GPU ID's that are to be used when training this Project. More... | |
DB_LOAD_METHOD | ImageLoadMethod [get] |
Returns the method used to load the images into memory. Loading all images into memory has the highest training performance for memory access is much faster than disk acces (even with an SSD). More... | |
int | ImageLoadLimit [get] |
Returns the image load limit. More... | |
int | ImageLoadLimitRefreshPeriod [get] |
Returns the image load limit refresh period in milliseconds. More... | |
double | ImageLoadLimitRefreshPercent [get] |
Returns the image load limit refresh percentage (to update). More... | |
SNAPSHOT_WEIGHT_UPDATE_METHOD | SnapshotWeightUpdateMethod [get] |
Returns the snapshot weight update favor. The snapshot can favor an improving accuracy, decreasing error, or both when saving weights. More... | |
SNAPSHOT_LOAD_METHOD | SnapshotLoadMethod [get] |
Returns the snapshot load method. When loading the best error or accuracy, the snapshot loaded may not be the last one taken. More... | |
string? | SolverDescription [getset] |
Get/set the solver description script used by the Project. More... | |
string? | ModelDescription [getset] |
Get/set the model description script used by the Project. More... | |
GroupDescriptor | ProjectGroup [get] |
Return the project group descriptor of the group that the Project resides (if any). More... | |
GroupDescriptor | ModelGroup [get] |
Return the model group descriptor of the group that the Project participates in (if any). More... | |
GroupDescriptor | DatasetGroup [get] |
Return the dataset group descriptor of the group that the Project participates in (if any). More... | |
ParameterDescriptorCollection | Parameters [get] |
Returns any project parameters that may exist (if any). More... | |
int | TotalIterations [getset] |
Get/set the total number of iterations that the Project has been trained. More... | |
bool | HasResults [get] |
Return whether or not the project has results from a training session. More... | |
int | Iterations [getset] |
Get/set the current number of iterations that the Project has been trained. More... | |
double | BestAccuracy [getset] |
Get/set the best accuracy observed while testing the Project. More... | |
double | BestError [getset] |
Get/set the best error observed while training the Project. More... | |
byte[] | SolverState [getset] |
Get/set the solver state. More... | |
byte[] | WeightsState [getset] |
Get/set the weight state. More... | |
string | DatasetName [get] |
Return the name of the dataset used. More... | |
DatasetDescriptor | Dataset [get] |
Return the descriptor of the dataset used. More... | |
DatasetDescriptor | DatasetTarget [get] |
Returns the target dataset (if exists) or null if it does not. More... | |
int | TargetDatasetID [getset] |
Get/set the dataset ID of the target dataset (if exists), otherwise return 0. More... | |
bool | ExistTestResults [get] |
Return whether or not testing results exist. More... | |
bool | ExistTrainResults [get] |
Return whether or not training results exist. More... | |
ValueDescriptorCollection | ProjectPerformanceItems [get] |
Return Project performance metrics. More... | |
string | ModelName [get] |
Return the name of the model used by the Project. More... | |
string | SolverType [get] |
Return the type of the Solver used by the Project. More... | |
Events | |
EventHandler< OverrideProjectArgs > | OnOverrideModel |
The OverrrideModel event fires each time the SetDataset function is called. More... | |
EventHandler< OverrideProjectArgs > | OnOverrideSolver |
The OverrideSolver event fires each time the SetDataset function is called. More... | |
The ProjectEx class manages a project containing the solver description, model description, data set (with training data source and testing data source) and project results.
Definition at line 14 of file ProjectEx.cs.
MyCaffe.basecode.ProjectEx.ProjectEx | ( | string | strName, |
string | strDsName = null |
||
) |
The ProjectEx constructor.
strName | Specifies the name of the project. |
strDsName | Optionally, specifies the name of the dataset used by the project. |
Definition at line 41 of file ProjectEx.cs.
MyCaffe.basecode.ProjectEx.ProjectEx | ( | ProjectDescriptor | prj, |
StateDescriptor | state = null , |
||
bool | bExistTrain = false , |
||
bool | bExistTest = false , |
||
bool | bQueryModel = true , |
||
bool | bQuerySolver = true |
||
) |
The ProjectEx constructor.
prj | Specifies the project descriptor for the project. |
state | Specifies the state descriptor for the project. |
bExistTrain | Specifies whether or not training results exist for the proejct. |
bExistTest | Specifies whether or not testing results exist for the project. |
bQueryModel | Optionally, specifies whether or not to set (and parse) the model. |
bQuerySolver | Optionally, specifies whether or not to set (and parse) the solver. |
Definition at line 57 of file ProjectEx.cs.
|
static |
Create a model description as a RawProto for running the Project.
strModelDescription | Specifies the model description to use. |
strName | Specifies the model name. |
nNum | Specifies the batch size to use. |
nChannels | Specifies the number of channels of each item in the batch. |
nHeight | Specifies the height of each item in the batch. |
nWidth | Specifies the width of each item in the batch. |
protoTransform | Returns a RawProto describing the Data Transformation parameters to use. |
bSkipTransformParam | Specifies to skip the transform parameter. |
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). |
Definition at line 1309 of file ProjectEx.cs.
RawProto MyCaffe.basecode.ProjectEx.CreateModelForRunning | ( | string | strName, |
int | nNum, | ||
int | nChannels, | ||
int | nHeight, | ||
int | nWidth, | ||
out RawProto | protoTransform, | ||
out bool | bSkipTransformParam, | ||
Stage | stage = Stage.NONE , |
||
bool | bSkipLossLayer = false |
||
) |
Create a model description as a RawProto for running the Project.
strName | Specifies the model name. |
nNum | Specifies the batch size to use. |
nChannels | Specifies the number of channels of each item in the batch. |
nHeight | Specifies the height of each item in the batch. |
nWidth | Specifies the width of each item in the batch. |
protoTransform | Returns a RawProto describing the Data Transformation parameters to use. |
bSkipTransformParam | Specifies to skip the transform parameter. |
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). |
Definition at line 1041 of file ProjectEx.cs.
|
static |
Create a model description as a RawProto for training the Project.
strModelDescription | Specifies the model description. |
strName | Specifies the model name. |
bCaffeFormat | Specifies whether or not the model description should use the native C++ caffe format where coloring is ordered in BGR, or use the MyCaffe format where coloring is ordered in RGB. |
Definition at line 1053 of file ProjectEx.cs.
bool MyCaffe.basecode.ProjectEx.DisableTesting | ( | ) |
Disables the testing interval so that no test passes are run.
Definition at line 2086 of file ProjectEx.cs.
|
static |
This method searches for a given parameter within a given layer, optionally for a certain Phase.
An example usage may be: layer = 'data', param = 'data_param', field = 'source'
strModelDescription | Specifies the model description to search. |
strLayerName | Specifies the name of the layer, when null only the layer type is used.. |
strLayerType | Specifies the type of the layer. |
strParam | Specifies the name of the parameter, such as 'data_param'. |
strField | Specifies the field of the parameter, such as 'source'. |
phaseMatch | Optionally, specifies the phase. |
Definition at line 2024 of file ProjectEx.cs.
int MyCaffe.basecode.ProjectEx.GetBatchSize | ( | Phase | phase | ) |
Returns the batch size of the project used in a given Phase.
phase | Specifies the Phase to use. |
Definition at line 359 of file ProjectEx.cs.
string MyCaffe.basecode.ProjectEx.GetCustomTrainer | ( | out string | strProperties | ) |
Returns the custom trainer and properties used by the project (if any).
strProperties | Specifies the properties associated with the custom trainer. The properties are stored in the solver parameter field 'custom_trainer_propeties' as a list of comma ('=') separated key value pairs each separated by ';' |
An example set of properties uses the following format: key1=val1;key2=val2;...
Definition at line 312 of file ProjectEx.cs.
double? MyCaffe.basecode.ProjectEx.GetLayerSetting | ( | Phase | phase, |
string | strLayer, | ||
string | strParam | ||
) |
Returns the setting of a Layer (if found).
phase | Specifies the Phase to use. |
strLayer | Specifies the Layer parameter name. |
strParam | Specifies the Layer setting name to look for. |
Definition at line 402 of file ProjectEx.cs.
string MyCaffe.basecode.ProjectEx.GetLayerSettingEx | ( | Phase | phase, |
string | strLayer, | ||
string | strParam | ||
) |
Returns the setting of a Layer (if found).
phase | Specifies the Phase to use. |
strLayer | Specifies the Layer parameter name. |
strParam | Specifies the Layer setting name to look for. |
Definition at line 418 of file ProjectEx.cs.
string MyCaffe.basecode.ProjectEx.GetSolverSetting | ( | string | strParam | ) |
Get a setting from the solver descriptor.
strParam | Specifies the setting to retrieve. |
Definition at line 453 of file ProjectEx.cs.
bool? MyCaffe.basecode.ProjectEx.GetSolverSettingAsBool | ( | string | strParam | ) |
Get a setting from the solver descriptor as a boolean value.
strParam | Specifies the setting to retrieve. |
Definition at line 502 of file ProjectEx.cs.
int? MyCaffe.basecode.ProjectEx.GetSolverSettingAsInt | ( | string | strParam | ) |
Get a setting from the solver descriptor as an integer value.
strParam | Specifies the setting to retrieve. |
Definition at line 488 of file ProjectEx.cs.
double? MyCaffe.basecode.ProjectEx.GetSolverSettingAsNumeric | ( | string | strParam | ) |
Get a setting from the solver descriptor as a double value.
strParam | Specifies the setting to retrieve. |
Definition at line 470 of file ProjectEx.cs.
void MyCaffe.basecode.ProjectEx.LoadModelFile | ( | string | strFile | ) |
Load the model description from a file.
strFile | Specifies the model file. |
Definition at line 1020 of file ProjectEx.cs.
void MyCaffe.basecode.ProjectEx.LoadSolverFile | ( | string | strFile | ) |
Load the solver description from a file.
strFile | Specifies the solver file. |
Definition at line 1008 of file ProjectEx.cs.
bool MyCaffe.basecode.ProjectEx.RequiresDataCriteria | ( | ) |
Returns whether or not the data criteria is required by the current project model (e.g. the model contains an AnnotatedData layer).
Definition at line 84 of file ProjectEx.cs.
void MyCaffe.basecode.ProjectEx.SetDataset | ( | DatasetDescriptor | dataset | ) |
Sets the dataset used by the Project, overriding the current dataset used.
Note, this function 'fixes' up the model used by the Project to use the new dataset.
dataset | Specifies the new dataset to use. |
Definition at line 1822 of file ProjectEx.cs.
|
static |
Sets the dataset of a model, overriding the current dataset used.
Note, this function 'fixes' up the model used by the Project to use the new dataset.
strModelDesc | Specifies the model description to update. |
dataset | Specifies the new dataset to use. |
bResized | Returns whether or not the model was resized with a different output size. |
bUpdateOutputs | Optionally, specifies whether or not to update the number of outputs in the last layer (e.g. the number of classes in the dataset). |
Definition at line 1869 of file ProjectEx.cs.
bool MyCaffe.basecode.ProjectEx.SetSolverVariable | ( | string | strVar, |
string | strVal | ||
) |
Set a given Solver variable in the solver description script.
strVar | Specifies the variable name. |
strVal | Specifies the variable value. |
Definition at line 985 of file ProjectEx.cs.
override string MyCaffe.basecode.ProjectEx.ToString | ( | ) |
Returns a string representation of the Project.
Definition at line 2134 of file ProjectEx.cs.
|
get |
Returns whether or not the Project is active.
Definition at line 567 of file ProjectEx.cs.
|
getset |
Get/set the best accuracy observed while testing the Project.
Definition at line 845 of file ProjectEx.cs.
|
getset |
Get/set the best error observed while training the Project.
Definition at line 854 of file ProjectEx.cs.
|
get |
Return the descriptor of the dataset used.
Definition at line 895 of file ProjectEx.cs.
|
getset |
Get/set whether or not the dataset for the project has been changed.
Definition at line 300 of file ProjectEx.cs.
|
get |
Return the dataset group descriptor of the group that the Project participates in (if any).
Definition at line 803 of file ProjectEx.cs.
|
get |
Return the name of the dataset used.
Definition at line 881 of file ProjectEx.cs.
|
get |
Returns the target dataset (if exists) or null if it does not.
The target dataset only applies when using both a source and target dataset.
Definition at line 906 of file ProjectEx.cs.
|
get |
Returns whether or not label balancing is enabled. When enabled, first the label set is randomly selected and then the image is selected from the label set using the image selection criteria (e.g. Random).
Definition at line 629 of file ProjectEx.cs.
|
get |
Returns whether or not label boosting is enabled. When using Label boosting, images are selected from boosted labels with a higher probability that images from other label sets.
Definition at line 638 of file ProjectEx.cs.
|
get |
Returns whether or not pair selection is enabled. When using pair selection, images are queried in pairs where the first query selects the image based on the image selection criteria (e.g. Random), and then the second image query returns the image just following the first image in the database.
Definition at line 657 of file ProjectEx.cs.
|
get |
Returns whether or not random image selection is enabled. When enabled, images are randomly selected from the entire set, or randomly from a label set when label balancing is in effect.
Definition at line 647 of file ProjectEx.cs.
|
get |
Return whether or not testing results exist.
Definition at line 942 of file ProjectEx.cs.
|
get |
Return whether or not training results exist.
Definition at line 950 of file ProjectEx.cs.
|
get |
Returns the list of comma separated GPU ID's that are to be used when training this Project.
Definition at line 665 of file ProjectEx.cs.
|
get |
Return whether or not the project has results from a training session.
Definition at line 828 of file ProjectEx.cs.
|
get |
Returns the ID of the Project in the database.
Definition at line 532 of file ProjectEx.cs.
|
get |
Returns the image load limit.
Definition at line 682 of file ProjectEx.cs.
|
get |
Returns the image load limit refresh percentage (to update).
Definition at line 698 of file ProjectEx.cs.
|
get |
Returns the image load limit refresh period in milliseconds.
Definition at line 690 of file ProjectEx.cs.
|
get |
Returns the method used to load the images into memory. Loading all images into memory has the highest training performance for memory access is much faster than disk acces (even with an SSD).
Definition at line 674 of file ProjectEx.cs.
|
getset |
Get/set the current number of iterations that the Project has been trained.
Definition at line 836 of file ProjectEx.cs.
|
getset |
Get/set the model description script used by the Project.
Definition at line 756 of file ProjectEx.cs.
|
get |
Return the model group descriptor of the group that the Project participates in (if any).
Definition at line 795 of file ProjectEx.cs.
|
get |
Return the name of the model used by the Project.
Definition at line 966 of file ProjectEx.cs.
|
getset |
Get/set the name of the Project.
Definition at line 523 of file ProjectEx.cs.
|
getset |
Get/set the original project ID.
Definition at line 540 of file ProjectEx.cs.
|
getset |
Get/set the ID of the Project owner.
Definition at line 558 of file ProjectEx.cs.
|
get |
Returns any project parameters that may exist (if any).
Definition at line 811 of file ProjectEx.cs.
|
get |
Return the project group descriptor of the group that the Project resides (if any).
Definition at line 787 of file ProjectEx.cs.
|
get |
Return Project performance metrics.
Definition at line 958 of file ProjectEx.cs.
|
getset |
Get/set the Caffe setting to use with the Project.
Definition at line 514 of file ProjectEx.cs.
|
get |
Returns the snapshot load method. When loading the best error or accuracy, the snapshot loaded may not be the last one taken.
Definition at line 717 of file ProjectEx.cs.
|
get |
Returns the snapshot weight update favor. The snapshot can favor an improving accuracy, decreasing error, or both when saving weights.
Note, weights updates are saved separately from the entire solver state that is snapshot on regular intervals.
Definition at line 709 of file ProjectEx.cs.
|
getset |
Get/set the solver description script used by the Project.
Definition at line 725 of file ProjectEx.cs.
|
getset |
Get/set the solver state.
Definition at line 863 of file ProjectEx.cs.
|
get |
Return the type of the Solver used by the Project.
Definition at line 974 of file ProjectEx.cs.
|
getset |
Return the stage under which the project was opened.
Definition at line 602 of file ProjectEx.cs.
|
getset |
Get/set the super boost probability used by the Project.
Definition at line 611 of file ProjectEx.cs.
|
getset |
Get/set the dataset ID of the target dataset (if exists), otherwise return 0.
Definition at line 914 of file ProjectEx.cs.
|
getset |
Get/set the total number of iterations that the Project has been trained.
Definition at line 819 of file ProjectEx.cs.
|
get |
Returns the training category of the project, or NONE if no custom trainer is used.
Definition at line 575 of file ProjectEx.cs.
|
get |
Returns whether or not the Project uses the training data source when testing (default = false).
Definition at line 620 of file ProjectEx.cs.
|
getset |
Get/set the weight state.
Definition at line 872 of file ProjectEx.cs.
EventHandler<OverrideProjectArgs> MyCaffe.basecode.ProjectEx.OnOverrideModel |
The OverrrideModel event fires each time the SetDataset function is called.
Definition at line 30 of file ProjectEx.cs.
EventHandler<OverrideProjectArgs> MyCaffe.basecode.ProjectEx.OnOverrideSolver |
The OverrideSolver event fires each time the SetDataset function is called.
Definition at line 34 of file ProjectEx.cs.