Commit 7927a230 authored by Rashad Kanavath's avatar Rashad Kanavath

Merge remote-tracking branch 'origin/develop' into update_pkg

parents c84f77af cbcb4458
......@@ -27,6 +27,12 @@ def ConvertString(s):
s = s.replace('*','\*')
return s
def ConvertToLineBlock(s):
'''Convert a string into a line bloc (prefix with |) '''
s = s.strip()
s = s.replace('*','\*')
s = " | " + s.replace('\n','\n | ')
return s
def EncloseString(s):
if not s.startswith("\"") :
......@@ -484,7 +490,7 @@ def ApplicationToRst(appname):
output += "These additional resources can be useful for further information: " + linesep
# hlink="<http://www.readthedocs.org/" + ConvertString(app.GetDocSeeAlso()) + ".html>`_ "
# output += linesep + "`" + ConvertString(app.GetDocSeeAlso()) + " " + hlink + linesep + linesep
output += linesep + ConvertString(app.GetDocSeeAlso()) + linesep + linesep
output += ConvertToLineBlock(app.GetDocSeeAlso()) + linesep + linesep
return output
......@@ -507,7 +513,7 @@ def GenerateRstForApplications():
allApps = None
try:
allApps = otbApplication.Registry.GetAvailableApplications( )
except e:
except:
print 'error in otbApplication.Registry.GetAvailableApplications()'
sys.exit(1)
......
......@@ -46,58 +46,59 @@ private:
void DoInit() ITK_OVERRIDE
{
SetName("MultivariateAlterationDetector");
SetDescription("Multivariate Alteration Detector");
SetDescription("Change detection by Multivariate Alteration Detector (MAD) algorithm");
// Documentation
SetDocName("Multivariate alteration detector");
SetDocLongDescription("This application detects change between two given images.");
SetDocLimitations("None");
SetDocName("Multivariate Alteration Detector");
SetDocLongDescription("This application performs change detection between two multispectral"
" images using the Multivariate Alteration Detector (MAD) [1]"
" algorithm.\n\n"
"The MAD algorithm produces a set of N change maps (where N is the"
" maximum number of bands in first and second input images), with the"
" following properties:\n"
" - Change maps are differences of a pair of linear combinations of "
" bands from image 1 and bands from image 2 chosen to maximize the "
" correlation, \n"
" - Each change map is orthogonal to the others.\n"
" \n"
"This is a statistical method which can handle different modalities"
" and even different bands and number of bands between images. \n"
" \n"
"The application will output all change maps into a single multiband"
" image. If numbers of bands in image 1 and 2 are equal, then change"
" maps are sorted by increasing correlation. If number of bands is"
" different, the change maps are sorted by decreasing correlation. \n"
" \n"
"The application will also print the following information:\n"
"- Mean1 and Mean2 which are the mean values of bands for both input"
" images,\n"
"- V1 and V2 which are the two linear transform that are applied to"
" input image 1 and input image 2 to build the change map,\n"
"- Rho, the vector of correlation associated to each change map.\n"
" \n"
"The OTB filter used in this application has been implemented from the"
" Matlab code kindly made available by the authors here [2]. Both cases"
" (same and different number of bands) have been validated"
" by comparing the output image to the output produced by the Matlab "
" code, and the reference images for testing have been generated from "
" the Matlab code using Octave." );
SetDocLimitations("Input images 1 and 2 should share exactly the same origin, spacing, size, and projection if any.");
SetDocAuthors("OTB-Team");
SetDocSeeAlso(" This filter implements the Multivariate Alteration Detector, based "
" on the following work: \n"
" A. A. Nielsen and K. Conradsen, Multivariate alteration detection"
" (mad) in multispectral, bi-temporal image data: a new approach to"
" change detection studies, Remote Sens. Environ., vol. 64,"
" pp. 1-19, (1998) \n"
" \n"
" Multivariate Alteration Detector takes two images as inputs and "
" produce a set of N change maps as a VectorImage (where N is the "
" maximum of number of bands in first and second image) with the "
" following properties: \n"
" - Change maps are differences of a pair of linear combinations of "
" bands from image 1 and bands from image 2 chosen to maximize the "
" correlation. \n"
" - Each change map is orthogonal to the others. \n"
" \n"
" This is a statistical method which can handle different modalities "
" and even different bands and number of bands between images. \n"
" \n"
" If numbers of bands in image 1 and 2 are equal, then change maps "
" are sorted by increasing correlation. If number of bands is "
" different, the change maps are sorted by decreasing correlation. \n"
" \n"
" The GetV1() and GetV2() methods allow retrieving the linear "
" combinations used to generate the Mad change maps as a vnl_matrix of "
" double, and the GetRho() method allows retrieving the correlation "
" associated to each Mad change maps as a vnl_vector. \n"
" \n"
" This filter has been implemented from the Matlab code kindly made "
" available by the authors here: \n"
" http://www2.imm.dtu.dk/~aa/software.html \n"
" \n"
" Both cases (same and different number of bands) have been validated "
" by comparing the output image to the output produced by the Matlab "
" code, and the reference images for testing have been generated from "
" the Matlab code using Octave." );
AddDocTag(Tags::FeatureExtraction);
SetDocSeeAlso("[1] Nielsen, A. A., & Conradsen, K. (1997). Multivariate alteration"
"detection (MAD) in multispectral, bi-temporal image data: A new"
"approach to change detection studies.\n"
"[2] http://www2.imm.dtu.dk/~aa/software.html");
AddDocTag(Tags::ChangeDetection);
AddParameter(ParameterType_InputImage, "in1", "Input Image 1");
SetParameterDescription("in1","Image which describe initial state of the scene.");
SetParameterDescription("in1","Multiband image of the scene before perturbations");
AddParameter(ParameterType_InputImage, "in2", "Input Image 2");
SetParameterDescription("in2","Image which describe scene after perturbations.");
SetParameterDescription("in2","Mutliband image of the scene after perturbations.");
AddParameter(ParameterType_OutputImage, "out", "Change Map");
SetParameterDescription("out","Image of detected changes.");
SetParameterDescription("out","Multiband image containing change maps. Each map will be in range [-1,1], so a floating point output type is advised.");
AddRAMParameter();
......
......@@ -48,12 +48,19 @@ private:
void DoInit() ITK_OVERRIDE
{
SetName("ComputeImagesStatistics");
SetDescription("Computes global mean and standard deviation for each band from a set of images and optionally saves the results in an XML file.");
SetDocName("Compute Images second order statistics");
SetDocLongDescription("This application computes a global mean and standard deviation for each band of a set of images and optionally saves the results in an XML file. The output XML is intended to be used an input for the TrainImagesClassifier application to normalize samples before learning.");
SetDocLimitations("Each image of the set must contain the same bands as the others (i.e. same types, in the same order).");
SetDescription("Computes global mean and standard deviation for each band "
"from a set of images and optionally saves the results in an XML file.");
SetDocLongDescription("This application computes a global mean and standard deviation "
"for each band of a set of images and optionally saves the results in an XML file."
" The output XML is intended to be used an input "
"for the TrainImagesClassifier application to normalize samples before learning. "
"You can also normalize the image with the XML file in the ImageClassifier application.");
SetDocLimitations("Each image of the set must contain the same bands as the others"
" (i.e. same types, in the same order).");
SetDocAuthors("OTB-Team");
SetDocSeeAlso("Documentation of the TrainImagesClassifier application.");
SetDocSeeAlso("Documentation of the TrainImagesClassifier and ImageClassifier application.");
AddDocTag(Tags::Learning);
AddDocTag(Tags::Analysis);
......
......@@ -108,7 +108,7 @@ private:
"confusion matrix file for the Dempster Shafer fusion.\n"
" - Input pixels with the NODATA label are not handled in the fusion of classification maps. Moreover, pixels for which all the input classifiers are set to NODATA "
"keep this value in the output fused image.\n"
" - In case of number of votes equality, the UNDECIDED label is attributed to the pixel.\n");
" - In case of number of votes equality, the UNDECIDED label is attributed to the pixel.");
SetDocLimitations("None");
SetDocAuthors("OTB-Team");
SetDocSeeAlso("ImageClassifier application");
......
......@@ -110,7 +110,7 @@ private:
" * strategy = smallest class\n\n"
" - if mim = proportional, then the smallest class size (computed globally) is used for the strategy constant+proportional.\n\n"
" - if mim = equal , then the smallest class size (computed globally) is used for the strategy constant+equal.\n\n"
" - if mim = custom , then the smallest class is computed and used for each image separately.\n\n"
" - if mim = custom , then the smallest class is computed and used for each image separately."
);
SetDocLimitations("None");
SetDocAuthors("OTB-Team");
......
......@@ -85,7 +85,7 @@ private:
"different for each type of geometry :\n"
" - polygon: select pixels whose center is inside the polygon\n"
" - lines : select pixels intersecting the line\n"
" - points : select closest pixel to the point\n");
" - points : select closest pixel to the point");
SetDocLimitations("None");
SetDocAuthors("OTB-Team");
SetDocSeeAlso(" ");
......
......@@ -120,7 +120,7 @@ private:
"polygons, lines, points. \nThe behavior of this application is different for each type of geometry : \n\n"
" - polygon: select points whose center is inside the polygon\n"
" - lines : select points intersecting the line\n"
" - points : select closest point to the provided point\n");
" - points : select closest point to the provided point");
SetDocLimitations("None");
SetDocAuthors("OTB-Team");
SetDocSeeAlso(" ");
......
......@@ -89,39 +89,52 @@ private:
void DoInit() ITK_OVERRIDE
{
SetName("VectorClassifier");
SetDescription("Performs a classification of the input vector data according to a model file."
"Features of the vector data output will contain the class labels decided by the classifier (maximal class label = 65535).");
SetDescription("Performs a classification of the input vector data according to a model file.");
SetDocName("Vector Classification");
SetDocAuthors("OTB-Team");
SetDocLongDescription("This application performs a vector data classification based on a model file produced by the TrainVectorClassifier application.");
SetDocLongDescription("This application performs a vector data classification "
"based on a model file produced by the TrainVectorClassifier application."
"Features of the vector data output will contain the class labels decided by the classifier "
"(maximal class label = 65535). \n"
"There are two modes: \n"
"1) Update mode: add of the 'cfield' field containing the predicted class in the input file. \n"
"2) Write mode: copies the existing fields of the input file in the output file "
" and add the 'cfield' field containing the predicted class. \n"
"If you have declared the output file, the write mode applies. "
"Otherwise, the input file update mode will be applied.");
SetDocLimitations("Shapefiles are supported. But the SQLite format is only supported in update mode.");
SetDocSeeAlso("TrainVectorClassifier");
AddDocTag(Tags::Learning);
AddParameter(ParameterType_InputVectorData, "in", "Name of the input vector data");
SetParameterDescription("in","The input vector data to classify.");
SetParameterDescription("in","The input vector data file to classify.");
AddParameter(ParameterType_InputFilename, "instat", "Statistics file");
SetParameterDescription("instat", "A XML file containing mean and standard deviation to center"
"and reduce samples before classification (produced by ComputeImagesStatistics application).");
"and reduce samples before classification, produced by ComputeImagesStatistics application.");
MandatoryOff("instat");
AddParameter(ParameterType_InputFilename, "model", "Model file");
SetParameterDescription("model", "A model file (produced by TrainVectorClassifier application,"
"maximal class label = 65535).");
SetParameterDescription("model", "Model file produced by TrainVectorClassifier application.");
AddParameter(ParameterType_String,"cfield","Field containing the predicted class");
AddParameter(ParameterType_String,"cfield","Field class");
SetParameterDescription("cfield","Field containing the predicted class."
"Only geometries with this field available will be taken into account.");
"Only geometries with this field available will be taken into account.\n"
"The field is added either in the input file (if 'out' off) or in the output file.\n"
"Caution, the 'cfield' must not exist in the input file if you are updating the file.");
SetParameterString("cfield","predicted", false);
AddParameter(ParameterType_ListView, "feat", "Field names to be calculated."); //
SetParameterDescription("feat","List of field names in the input vector data used as features for training."); //
AddParameter(ParameterType_ListView, "feat", "Field names to be calculated.");
SetParameterDescription("feat","List of field names in the input vector data used as features for training. "
"Put the same field names as the TrainVectorClassifier application.");
AddParameter(ParameterType_Empty, "confmap", "Confidence map");
SetParameterDescription( "confmap", "Confidence map of the produced classification. The confidence index depends on the model : \n"
" - LibSVM : difference between the two highest probabilities (needs a model with probability estimates, so that classes probabilities can be computed for each sample)\n"
SetParameterDescription( "confmap", "Confidence map of the produced classification. "
"The confidence index depends on the model : \n"
" - LibSVM : difference between the two highest probabilities "
"(needs a model with probability estimates, so that classes probabilities can be computed for each sample)\n"
" - OpenCV\n"
" * Boost : sum of votes\n"
" * DecisionTree : (not supported)\n"
......@@ -129,8 +142,9 @@ private:
" * KNearestNeighbors : number of neighbors with the same label\n"
" * NeuralNetwork : difference between the two highest responses\n"
" * NormalBayes : (not supported)\n"
" * RandomForest : Confidence (proportion of votes for the majority class). Margin (normalized difference of the votes of the 2 majority classes) is not available for now.\n"
" * SVM : distance to margin (only works for 2-class models)\n");
" * RandomForest : Confidence (proportion of votes for the majority class). "
"Margin (normalized difference of the votes of the 2 majority classes) is not available for now.\n"
" * SVM : distance to margin (only works for 2-class models).\n");
MandatoryOff("confmap");
AddParameter(ParameterType_OutputFilename, "out", "Output vector data file containing class labels");
......@@ -142,7 +156,7 @@ private:
SetDocExampleParameterValue("in", "vectorData.shp");
SetDocExampleParameterValue("instat", "meanVar.xml");
SetDocExampleParameterValue("model", "svmModel.svm");
SetDocExampleParameterValue("out", "svmModel.svm");
SetDocExampleParameterValue("out", "vectorDataLabeledVector.shp");
SetDocExampleParameterValue("feat", "perimeter area width");
SetDocExampleParameterValue("cfield", "predicted");
......
......@@ -39,11 +39,28 @@ namespace Wrapper
//BoostType
AddParameter(ParameterType_Choice, "classifier.boost.t", "Boost Type");
AddChoice("classifier.boost.t.discrete", "Discrete AdaBoost");
AddChoice("classifier.boost.t.real", "Real AdaBoost (technique using confidence-rated predictions "
"and working well with categorical data)");
AddChoice("classifier.boost.t.logit", "LogitBoost (technique producing good regression fits)");
AddChoice("classifier.boost.t.gentle", "Gentle AdaBoost (technique setting less weight on outlier data points "
"and, for that reason, being often good with regression data)");
SetParameterDescription("classifier.boost.t.discrete",
"This procedure trains the classifiers on weighted versions of the training "
"sample, giving higher weight to cases that are currently misclassified. "
"This is done for a sequence of weighter samples, and then the final "
"classifier is defined as a linear combination of the classifier from "
"each stage.");
AddChoice("classifier.boost.t.real",
"Real AdaBoost (technique using confidence-rated predictions "
"and working well with categorical data)");
SetParameterDescription("classifier.boost.t.real",
"Adaptation of the Discrete Adaboost algorithm with Real value");
AddChoice("classifier.boost.t.logit",
"LogitBoost (technique producing good regression fits)");
SetParameterDescription("classifier.boost.t.logit",
"This procedure is an adaptive Newton algorithm for fitting an additive "
"logistic regression model. Beware it can produce numeric instability.");
AddChoice("classifier.boost.t.gentle",
"Gentle AdaBoost (technique setting less weight on outlier data points "
"and, for that reason, being often good with regression data)");
SetParameterDescription("classifier.boost.t.gentle",
"A modified version of the Real Adaboost algorithm, using Newton stepping "
"rather than exact optimization at each step.");
SetParameterString("classifier.boost.t", "real", false);
SetParameterDescription("classifier.boost.t", "Type of Boosting algorithm.");
//Do not expose SplitCriteria
......@@ -54,9 +71,11 @@ namespace Wrapper
//WeightTrimRate
AddParameter(ParameterType_Float, "classifier.boost.r", "Weight Trim Rate");
SetParameterFloat("classifier.boost.r",0.95, false);
SetParameterDescription("classifier.boost.r","A threshold between 0 and 1 used to save computational time. "
"Samples with summary weight <= (1 - weight_trim_rate) do not participate in the next iteration of training. "
"Set this parameter to 0 to turn off this functionality.");
SetParameterDescription("classifier.boost.r",
"A threshold between 0 and 1 used to save computational time. "
"Samples with summary weight <= (1 - weight_trim_rate) do not participate in"
" the next iteration of training. Set this parameter to 0 to turn off this "
"functionality.");
//MaxDepth : Not sure that this parameter has to be exposed.
AddParameter(ParameterType_Int, "classifier.boost.m", "Maximum depth of the tree");
SetParameterInt("classifier.boost.m",1, false);
......
......@@ -35,8 +35,8 @@ LearningApplicationBase<TInputValue,TOutputValue>
{
AddChoice("classifier.dt", "Decision Tree classifier");
SetParameterDescription("classifier.dt",
"This group of parameters allows setting Decision Tree classifier parameters. "
"See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/decision_trees.html}.");
"This group of parameters allows setting Decision Tree classifier parameters. "
"See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/decision_trees.html}.");
//MaxDepth
AddParameter(ParameterType_Int, "classifier.dt.max", "Maximum depth of the tree");
#ifdef OTB_OPENCV_3
......@@ -44,23 +44,25 @@ LearningApplicationBase<TInputValue,TOutputValue>
#else
SetParameterInt("classifier.dt.max",65535, false);
#endif
SetParameterDescription(
"classifier.dt.max", "The training algorithm attempts to split each node while its depth is smaller than the maximum "
"possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
"if the tree is pruned.");
SetParameterDescription("classifier.dt.max",
"The training algorithm attempts to split each node while its depth is smaller "
"than the maximum possible depth of the tree. The actual depth may be smaller "
"if the other termination criteria are met, and/or if the tree is pruned.");
//MinSampleCount
AddParameter(ParameterType_Int, "classifier.dt.min", "Minimum number of samples in each node");
SetParameterInt("classifier.dt.min",10, false);
SetParameterDescription("classifier.dt.min", "If the number of samples in a node is smaller than this parameter, "
"then this node will not be split.");
SetParameterDescription("classifier.dt.min",
"If the number of samples in a node is smaller "
"than this parameter, then this node will not be split.");
//RegressionAccuracy
AddParameter(ParameterType_Float, "classifier.dt.ra", "Termination criteria for regression tree");
SetParameterFloat("classifier.dt.ra",0.01, false);
SetParameterDescription("classifier.dt.min", "If all absolute differences between an estimated value in a node "
"and the values of the train samples in this node are smaller than this regression accuracy parameter, "
"then the node will not be split.");
SetParameterDescription("classifier.dt.ra",
"If all absolute differences between an estimated value in a node "
"and the values of the train samples in this node are smaller than this "
"regression accuracy parameter, then the node will not be split further.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.dt.sur", "Surrogate splits will be built");
......@@ -68,11 +70,12 @@ LearningApplicationBase<TInputValue,TOutputValue>
//MaxCategories
AddParameter(ParameterType_Int, "classifier.dt.cat",
"Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split");
"Cluster possible values of a categorical variable into K <= cat clusters to find a "
"suboptimal split");
SetParameterInt("classifier.dt.cat",10, false);
SetParameterDescription(
"classifier.dt.cat",
"Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split.");
SetParameterDescription("classifier.dt.cat",
"Cluster possible values of a categorical variable into K <= cat clusters to find a "
"suboptimal split.");
//CVFolds
AddParameter(ParameterType_Int, "classifier.dt.f", "K-fold cross-validations");
......@@ -82,18 +85,20 @@ LearningApplicationBase<TInputValue,TOutputValue>
#else
SetParameterInt("classifier.dt.f",10, false);
#endif
SetParameterDescription(
"classifier.dt.f", "If cv_folds > 1, then it prunes a tree with K-fold cross-validation where K is equal to cv_folds.");
SetParameterDescription("classifier.dt.f",
"If cv_folds > 1, then it prunes a tree with K-fold cross-validation where K "
"is equal to cv_folds.");
//Use1seRule
AddParameter(ParameterType_Empty, "classifier.dt.r", "Set Use1seRule flag to false");
SetParameterDescription(
"classifier.dt.r",
"If true, then a pruning will be harsher. This will make a tree more compact and more resistant to the training data noise but a bit less accurate.");
SetParameterDescription("classifier.dt.r",
"If true, then a pruning will be harsher. This will make a tree more compact and more "
"resistant to the training data noise but a bit less accurate.");
//TruncatePrunedTree
AddParameter(ParameterType_Empty, "classifier.dt.t", "Set TruncatePrunedTree flag to false");
SetParameterDescription("classifier.dt.t", "If true, then pruned branches are physically removed from the tree.");
SetParameterDescription("classifier.dt.t",
"If true, then pruned branches are physically removed from the tree.");
//Priors are not exposed.
......
......@@ -103,7 +103,7 @@ namespace Wrapper
SetParameterDescription("classifier.libsvm.nu",
"Cost parameter Nu, in the range 0..1, the larger the value, "
"the smoother the decision.");
// It seems that it miss a nu parameter for the nu-SVM use.
AddParameter(ParameterType_Empty, "classifier.libsvm.opt", "Parameters optimization");
MandatoryOff("classifier.libsvm.opt");
......@@ -120,11 +120,6 @@ namespace Wrapper
"The distance between feature vectors from the training set and "
"the fitting hyper-plane must be less than Epsilon. For outliers"
"the penalty mutliplier is set by C.");
// AddParameter(ParameterType_Float, "classifier.libsvm.nu", "Nu");
// SetParameterFloat("classifier.libsvm.nu",0.5, false);
// SetParameterDescription("classifier.libsvm.nu",
// "Cost parameter Nu, in the range 0..1, the larger the value, "
// "the smoother the decision.");
}
}
......@@ -214,4 +209,4 @@ namespace Wrapper
} //end namespace wrapper
} //end namespace otb
#endif
\ No newline at end of file
#endif
......@@ -36,95 +36,125 @@ LearningApplicationBase<TInputValue,TOutputValue>
{
AddChoice("classifier.ann", "Artificial Neural Network classifier");
SetParameterDescription("classifier.ann",
"This group of parameters allows setting Artificial Neural Network classifier parameters. "
"See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/neural_networks.html}.");
"This group of parameters allows setting Artificial Neural Network "
"classifier parameters. See complete documentation here "
"\\url{http://docs.opencv.org/modules/ml/doc/neural_networks.html}.");
//TrainMethod
AddParameter(ParameterType_Choice, "classifier.ann.t", "Train Method Type");
AddChoice("classifier.ann.t.reg", "RPROP algorithm");
AddChoice("classifier.ann.t.back", "Back-propagation algorithm");
SetParameterDescription("classifier.ann.t.back",
"Method to compute the gradient of the loss function and adjust weights "
"in the network to optimize the result.");
AddChoice("classifier.ann.t.reg", "Resilient Back-propagation algorithm");
SetParameterDescription("classifier.ann.t.reg",
"Almost the same as the Back-prop algorithm exept that it does not "
"take into account the magnitude of the partial derivative (coordinate "
"of the gradient) but only its sign.");
SetParameterString("classifier.ann.t", "reg", false);
SetParameterDescription("classifier.ann.t", "Type of training method for the multilayer perceptron (MLP) neural network.");
SetParameterDescription("classifier.ann.t",
"Type of training method for the multilayer perceptron (MLP) neural network.");
//LayerSizes
//There is no ParameterType_IntList, so i use a ParameterType_StringList and convert it.
/*std::vector<std::string> layerSizes;
layerSizes.push_back("100");
layerSizes.push_back("100"); */
AddParameter(ParameterType_StringList, "classifier.ann.sizes", "Number of neurons in each intermediate layer");
AddParameter(ParameterType_StringList, "classifier.ann.sizes",
"Number of neurons in each intermediate layer");
//SetParameterStringList("classifier.ann.sizes", layerSizes);
SetParameterDescription("classifier.ann.sizes",
"The number of neurons in each intermediate layer (excluding input and output layers).");
"The number of neurons in each intermediate layer (excluding input and output layers).");
//ActivateFunction
AddParameter(ParameterType_Choice, "classifier.ann.f", "Neuron activation function type");
AddParameter(ParameterType_Choice, "classifier.ann.f",
"Neuron activation function type");
AddChoice("classifier.ann.f.ident", "Identity function");
AddChoice("classifier.ann.f.sig", "Symmetrical Sigmoid function");
AddChoice("classifier.ann.f.gau", "Gaussian function (Not completely supported)");
SetParameterString("classifier.ann.f", "sig", false);
SetParameterDescription("classifier.ann.f", "Neuron activation function.");
SetParameterDescription("classifier.ann.f",
"This function determine whether the output of the node is positive or not "
"depending on the output of the transfert function.");
//Alpha
AddParameter(ParameterType_Float, "classifier.ann.a", "Alpha parameter of the activation function");
AddParameter(ParameterType_Float, "classifier.ann.a",
"Alpha parameter of the activation function");
SetParameterFloat("classifier.ann.a",1., false);
SetParameterDescription("classifier.ann.a",
"Alpha parameter of the activation function (used only with sigmoid and gaussian functions).");
"Alpha parameter of the activation function (used only with sigmoid and gaussian functions).");
//Beta
AddParameter(ParameterType_Float, "classifier.ann.b", "Beta parameter of the activation function");
AddParameter(ParameterType_Float, "classifier.ann.b",
"Beta parameter of the activation function");
SetParameterFloat("classifier.ann.b",1., false);
SetParameterDescription("classifier.ann.b",
"Beta parameter of the activation function (used only with sigmoid and gaussian functions).");
"Beta parameter of the activation function (used only with sigmoid and gaussian functions).");
//BackPropDWScale
AddParameter(ParameterType_Float, "classifier.ann.bpdw",
"Strength of the weight gradient term in the BACKPROP method");
"Strength of the weight gradient term in the BACKPROP method");
SetParameterFloat("classifier.ann.bpdw",0.1, false);
SetParameterDescription(
"classifier.ann.bpdw",
"Strength of the weight gradient term in the BACKPROP method. The recommended value is about 0.1.");
SetParameterDescription("classifier.ann.bpdw",
"Strength of the weight gradient term in the BACKPROP method. The "
"recommended value is about 0.1.");
//BackPropMomentScale
AddParameter(ParameterType_Float, "classifier.ann.bpms",
"Strength of the momentum term (the difference between weights on the 2 previous iterations)");
"Strength of the momentum term (the difference between weights on the 2 previous iterations)");
SetParameterFloat("classifier.ann.bpms",0.1, false);
SetParameterDescription(
"classifier.ann.bpms",
"Strength of the momentum term (the difference between weights on the 2 previous iterations). "
"This parameter provides some inertia to smooth the random fluctuations of the weights. "
"It can vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough.");
SetParameterDescription("classifier.ann.bpms",
"Strength of the momentum term (the difference between weights on the 2 previous "
"iterations). This parameter provides some inertia to smooth the random "
"fluctuations of the weights. It can vary from 0 (the feature is disabled) "
"to 1 and beyond. The value 0.1 or so is good enough.");
//RegPropDW0
AddParameter(ParameterType_Float, "classifier.ann.rdw",
"Initial value Delta_0 of update-values Delta_{ij} in RPROP method");
"Initial value Delta_0 of update-values Delta_{ij} in RPROP method");
SetParameterFloat("classifier.ann.rdw",0.1, false);
SetParameterDescription("classifier.ann.rdw", "Initial value Delta_0 of update-values Delta_{ij} in RPROP method (default = 0.1).");
SetParameterDescription("classifier.ann.rdw",
"Initial value Delta_0 of update-values Delta_{ij} in RPROP method (default = 0.1).");
//RegPropDWMin
AddParameter(ParameterType_Float, "classifier.ann.rdwm", "Update-values lower limit Delta_{min} in RPROP method");
AddParameter(ParameterType_Float, "classifier.ann.rdwm",
"Update-values lower limit Delta_{min} in RPROP method");
SetParameterFloat("classifier.ann.rdwm",1e-7, false);
SetParameterDescription(
"classifier.ann.rdwm",
"Update-values lower limit Delta_{min} in RPROP method. It must be positive (default = 1e-7).");
SetParameterDescription("classifier.ann.rdwm",
"Update-values lower limit Delta_{min} in RPROP method. It must be positive "
"(default = 1e-7).");
//TermCriteriaType
AddParameter(ParameterType_Choice, "classifier.ann.term", "Termination criteria");
AddChoice("classifier.ann.term.iter", "Maximum number of iterations");
SetParameterDescription("classifier.ann.term.iter",
"Set the number of iterations allowed to the network for its "
"training. Training will stop regardless of the result when this "
"number is reached");
AddChoice("classifier.ann.term.eps", "Epsilon");
SetParameterDescription("classifier.ann.term.eps",
"Training will focus on result and will stop once the precision is"
"at most epsilon");
AddChoice("classifier.ann.term.all", "Max. iterations + Epsilon");
SetParameterDescription("classifier.ann.term.all",
"Both termination criteria are used. Training stop at the first reached");
SetParameterString("classifier.ann.term", "all", false);
SetParameterDescription("classifier.ann.term", "Termination criteria.");
//Epsilon
AddParameter(ParameterType_Float, "classifier.ann.eps", "Epsilon value used in the Termination criteria");
AddParameter(ParameterType_Float, "classifier.ann.eps",
"Epsilon value used in the Termination criteria");
SetParameterFloat("classifier.ann.eps",0.01, false);
SetParameterDescription("classifier.ann.eps", "Epsilon value used in the Termination criteria.");
SetParameterDescription("classifier.ann.eps",
"Epsilon value used in the Termination criteria.");
//MaxIter
AddParameter(ParameterType_Int, "classifier.ann.iter",
"Maximum number of iterations used in the Termination criteria");
"Maximum number of iterations used in the Termination criteria");
SetParameterInt("classifier.ann.iter",1000, false);
SetParameterDescription("classifier.ann.iter", "Maximum number of iterations used in the Termination criteria.");
SetParameterDescription("classifier.ann.iter",
"Maximum number of iterations used in the Termination criteria.");
}
......@@ -143,12 +173,12 @@ LearningApplicationBase<TInputValue,TOutputValue>
switch (GetParameterInt("classifier.ann.t"))
{
case 0: // RPROP
classifier->SetTrainMethod(CvANN_MLP_TrainParams::RPROP);
break;
case 1: // BACKPROP
case 0: // BACKPROP
classifier->SetTrainMethod(CvANN_MLP_TrainParams::BACKPROP);
break;
case 1: // RPROP
classifier->SetTrainMethod(CvANN_MLP_TrainParams::RPROP);
break;
default: // DEFAULT = RPROP
classifier->SetTrainMethod(CvANN_MLP_TrainParams::RPROP);
break;
......
......@@ -53,6 +53,7 @@ namespace Wrapper
}
AddParameter(ParameterType_Choice, "classifier.svm.k", "SVM Kernel Type");
AddChoice("classifier.svm.k.linear", "Linear");
AddChoice("classifier.svm.k.rbf", "Gaussian radial basis function");
AddChoice("classifier.svm.k.poly", "Polynomial");
AddChoice("classifier.svm.k.sigmoid", "Sigmoid");
......@@ -60,52 +61,71 @@ namespace Wrapper
SetParameterDescription("classifier.svm.k", "SVM Kernel Type.");
AddParameter(ParameterType_Float, "classifier.svm.c", "Cost parameter C");
SetParameterFloat("classifier.svm.c",1.0, false);
SetParameterDescription(
"classifier.svm.c",
"SVM models have a cost parameter C (1 by default) to control the trade-off between training errors and forcing rigid margins.");
SetParameterDescription("classifier.svm.c",
"SVM models have a cost parameter C (1 by default) to control the trade-off"
" between training errors and forcing rigid margins.");
AddParameter(ParameterType_Float, "classifier.svm.nu",
"Parameter nu of a SVM optimization problem (NU_SVC / ONE_CLASS)");
SetParameterFloat("classifier.svm.nu",0.0, false);
SetParameterDescription("classifier.svm.nu", "Parameter nu of a SVM optimization problem.");
SetParameterDescription("classifier.svm.nu",
"Parameter nu of a SVM optimization problem.");
if (this->m_RegressionFlag)
{
AddParameter(ParameterType_Float, "classifier.svm.p", "Parameter epsilon of a SVM optimization problem (EPS_SVR)");
SetParameterFloat("classifier.svm.p",1.0, false);
SetParameterDescription("classifier.svm.p", "Parameter epsilon of a SVM optimization problem (EPS_SVR).");
AddParameter(ParameterType_Choice, "classifier.svm.term", "Termination criteria");
SetParameterDescription("classifier.svm.term","Termination criteria for iterative algorithm");
AddChoice("classifier.svm.term.iter", "Stops when maximum iteration is reached.");
AddChoice("classifier.svm.term.eps", "Stops when accuracy is lower than epsilon.");
AddChoice("classifier.svm.term.all", "Stops when either iteration or epsilon criteria is true");
AddParameter(ParameterType_Choice,
"classifier.svm.term", "Termination criteria");
SetParameterDescription("classifier.svm.term",
"Termination criteria for iterative algorithm");
AddChoice("classifier.svm.term.iter",
"Stops when maximum iteration is reached.");
AddChoice("classifier.svm.term.eps",
"Stops when accuracy is lower than epsilon.");
AddChoice("classifier.svm.term.all",
"Stops when either iteration or epsilon criteria is true");
AddParameter(ParameterType_Float, "classifier.svm.iter", "Maximum iteration");
SetParameterFloat("classifier.svm.iter",1000, false);
SetParameterDescription("classifier.svm.iter", "Maximum number of iterations (corresponds to the termination criteria 'iter').");
SetParameterDescription("classifier.svm.iter",
"Maximum number of iterations (corresponds to the termination criteria 'iter').");
AddParameter(ParameterType_Float, "classifier.svm.eps", "Epsilon accuracy threshold");
AddParameter(ParameterType_Float, "classifier.svm.eps",
"Epsilon accuracy threshold");
SetParameterFloat("classifier.svm.eps",FLT_EPSILON, false);
SetParameterDescription("classifier.svm.eps", "Epsilon accuracy (corresponds to the termination criteria 'eps').");
SetParameterDescription("classifier.svm.eps",
"Epsilon accuracy (corresponds to the termination criteria 'eps').");
}
AddParameter(ParameterType_Float, "classifier.svm.coef0", "Parameter coef0 of a kernel function (POLY / SIGMOID)");
AddParameter(ParameterType_Float, "classifier.svm.coef0",
"Parameter coef0 of a kernel function (POLY / SIGMOID)");