@Namespace(value="cv::ml") public static class opencv_ml.ANN_MLP extends opencv_ml.StatModel
Unlike many other models in ML that are constructed and trained at once, in the MLP model these steps are separated. First, a network with the specified topology is created using the non-default constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is trained using a set of input and output vectors. The training procedure can be repeated more than once, that is, the weights can be adjusted based on the new training data.
Additional flags for StatModel::train are available: ANN_MLP::TrainFlags.
\sa \ref ml_intro_ann
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Modifier and Type | Field and Description |
|---|---|
static int |
BACKPROP
enum cv::ml::ANN_MLP::TrainingMethods
|
static int |
GAUSSIAN
enum cv::ml::ANN_MLP::ActivationFunctions
|
static int |
IDENTITY
enum cv::ml::ANN_MLP::ActivationFunctions
|
static int |
NO_INPUT_SCALE
enum cv::ml::ANN_MLP::TrainFlags
|
static int |
NO_OUTPUT_SCALE
enum cv::ml::ANN_MLP::TrainFlags
|
static int |
RPROP
enum cv::ml::ANN_MLP::TrainingMethods
|
static int |
SIGMOID_SYM
enum cv::ml::ANN_MLP::ActivationFunctions
|
static int |
UPDATE_WEIGHTS
enum cv::ml::ANN_MLP::TrainFlags
|
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL| Constructor and Description |
|---|
opencv_ml.ANN_MLP(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static opencv_ml.ANN_MLP |
create()
\brief Creates empty model
|
double |
getBackpropMomentumScale() |
double |
getBackpropWeightScale() |
opencv_core.Mat |
getLayerSizes()
Integer vector specifying the number of neurons in each layer including the input and output layers.
|
double |
getRpropDW0() |
double |
getRpropDWMax() |
double |
getRpropDWMin() |
double |
getRpropDWMinus() |
double |
getRpropDWPlus() |
opencv_core.TermCriteria |
getTermCriteria() |
int |
getTrainMethod()
Returns current training method
|
opencv_core.Mat |
getWeights(int layerIdx) |
void |
setActivationFunction(int type) |
void |
setActivationFunction(int type,
double param1,
double param2)
Initialize the activation function for each neuron.
|
void |
setBackpropMomentumScale(double val)
\copybrief getBackpropMomentumScale @see getBackpropMomentumScale
|
void |
setBackpropWeightScale(double val)
\copybrief getBackpropWeightScale @see getBackpropWeightScale
|
void |
setLayerSizes(opencv_core.Mat _layer_sizes)
Integer vector specifying the number of neurons in each layer including the input and output layers.
|
void |
setRpropDW0(double val)
\copybrief getRpropDW0 @see getRpropDW0
|
void |
setRpropDWMax(double val)
\copybrief getRpropDWMax @see getRpropDWMax
|
void |
setRpropDWMin(double val)
\copybrief getRpropDWMin @see getRpropDWMin
|
void |
setRpropDWMinus(double val)
\copybrief getRpropDWMinus @see getRpropDWMinus
|
void |
setRpropDWPlus(double val)
\copybrief getRpropDWPlus @see getRpropDWPlus
|
void |
setTermCriteria(opencv_core.TermCriteria val)
\copybrief getTermCriteria @see getTermCriteria
|
void |
setTrainMethod(int method) |
void |
setTrainMethod(int method,
double param1,
double param2)
Sets training method and common parameters.
|
calcError, empty, getVarCount, isClassifier, isTrained, predict, predict, train, train, trainloadANN_MLP, loadANN_MLP, loadBoost, loadBoost, loadDTrees, loadDTrees, loadEM, loadEM, loadKNearest, loadKNearest, loadLogisticRegression, loadLogisticRegression, loadNormalBayesClassifier, loadNormalBayesClassifier, loadRTrees, loadRTrees, loadSVM, loadSVMclear, getDefaultName, position, read, save, save, writeaddress, asBuffer, asByteBuffer, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zeropublic static final int BACKPROP
public static final int RPROP
public static final int IDENTITY
public static final int SIGMOID_SYM
public static final int GAUSSIAN
public static final int UPDATE_WEIGHTS
public static final int NO_INPUT_SCALE
public static final int NO_OUTPUT_SCALE
public opencv_ml.ANN_MLP(Pointer p)
Pointer.Pointer(Pointer).public void setTrainMethod(int method,
double param1,
double param2)
method - Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods.param1 - passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROPparam2 - passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP.public void setTrainMethod(int method)
public int getTrainMethod()
public void setActivationFunction(int type,
double param1,
double param2)
type - The type of activation function. See ANN_MLP::ActivationFunctions.param1 - The first parameter of the activation function, \f$\alpha\f$. Default value is 0.param2 - The second parameter of the activation function, \f$\beta\f$. Default value is 0.public void setActivationFunction(int type)
public void setLayerSizes(@ByVal opencv_core.Mat _layer_sizes)
@ByVal public opencv_core.Mat getLayerSizes()
@ByVal public opencv_core.TermCriteria getTermCriteria()
setTermCriteriapublic void setTermCriteria(@ByVal opencv_core.TermCriteria val)
public double getBackpropWeightScale()
setBackpropWeightScalepublic void setBackpropWeightScale(double val)
public double getBackpropMomentumScale()
setBackpropMomentumScalepublic void setBackpropMomentumScale(double val)
public double getRpropDW0()
setRpropDW0public void setRpropDW0(double val)
public double getRpropDWPlus()
setRpropDWPluspublic void setRpropDWPlus(double val)
public double getRpropDWMinus()
setRpropDWMinuspublic void setRpropDWMinus(double val)
public double getRpropDWMin()
setRpropDWMinpublic void setRpropDWMin(double val)
public double getRpropDWMax()
setRpropDWMaxpublic void setRpropDWMax(double val)
@ByVal public opencv_core.Mat getWeights(int layerIdx)
@opencv_core.Ptr public static opencv_ml.ANN_MLP create()
Use StatModel::train to train the model, Algorithm::load\
Copyright © 2016. All rights reserved.