OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
Artificial Neural Networks - Multi-Layer Perceptrons. More...
Public Member Functions | |
double | getAnnealCoolingRatio () |
double | getAnnealFinalT () |
double | getAnnealInitialT () |
int | getAnnealItePerStep () |
double | getBackpropMomentumScale () |
double | getBackpropWeightScale () |
Mat | getLayerSizes () |
double | getRpropDW0 () |
double | getRpropDWMax () |
double | getRpropDWMin () |
double | getRpropDWMinus () |
double | getRpropDWPlus () |
TermCriteria | getTermCriteria () |
double double double epsilon | getTermCriteriaAsValueTuple () |
Vec3d | getTermCriteriaAsVec3d () |
int | getTrainMethod () |
Mat | getWeights (int layerIdx) |
void | setActivationFunction (int type) |
void | setActivationFunction (int type, double param1) |
void | setActivationFunction (int type, double param1, double param2) |
void | setAnnealCoolingRatio (double val) |
void | setAnnealFinalT (double val) |
void | setAnnealInitialT (double val) |
void | setAnnealItePerStep (int val) |
void | setBackpropMomentumScale (double val) |
void | setBackpropWeightScale (double val) |
void | setLayerSizes (Mat _layer_sizes) |
void | setRpropDW0 (double val) |
void | setRpropDWMax (double val) |
void | setRpropDWMin (double val) |
void | setRpropDWMinus (double val) |
void | setRpropDWPlus (double val) |
void | setTermCriteria (in Vec3d val) |
void | setTermCriteria (in(double type, double maxCount, double epsilon) val) |
void | setTermCriteria (TermCriteria val) |
void | setTrainMethod (int method) |
void | setTrainMethod (int method, double param1) |
void | setTrainMethod (int method, double param1, double param2) |
Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
float | calcError (TrainData data, bool test, Mat resp) |
Computes error on the training or test dataset. | |
override bool | empty () |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. | |
int | getVarCount () |
Returns the number of variables in training samples. | |
bool | isClassifier () |
Returns true if the model is classifier. | |
bool | isTrained () |
Returns true if the model is trained. | |
virtual float | predict (Mat samples) |
Predicts response(s) for the provided sample(s) | |
virtual float | predict (Mat samples, Mat results) |
Predicts response(s) for the provided sample(s) | |
virtual float | predict (Mat samples, Mat results, int flags) |
Predicts response(s) for the provided sample(s) | |
bool | train (Mat samples, int layout, Mat responses) |
Trains the statistical model. | |
bool | train (TrainData trainData) |
Trains the statistical model. | |
bool | train (TrainData trainData, int flags) |
Trains the statistical model. | |
Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
virtual void | clear () |
Clears the algorithm state. | |
virtual string | getDefaultName () |
IntPtr | getNativeObjAddr () |
void | save (string filename) |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static new ANN_MLP | __fromPtr__ (IntPtr addr) |
static ANN_MLP | create () |
Creates empty model. | |
static ANN_MLP | load (string filepath) |
Loads and creates a serialized ANN from a file. | |
Static Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
static new StatModel | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
static Algorithm | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Public Attributes | |
double double | maxCount |
double | type |
Static Public Attributes | |
const int | ANNEAL = 2 |
const int | BACKPROP = 0 |
const int | GAUSSIAN = 2 |
const int | IDENTITY = 0 |
const int | LEAKYRELU = 4 |
const int | NO_INPUT_SCALE = 2 |
const int | NO_OUTPUT_SCALE = 4 |
const int | RELU = 3 |
const int | RPROP = 1 |
const int | SIGMOID_SYM = 1 |
const int | UPDATE_WEIGHTS = 1 |
Static Public Attributes inherited from OpenCVForUnity.MlModule.StatModel | |
const int | COMPRESSED_INPUT = 2 |
const int | PREPROCESSED_INPUT = 4 |
const int | RAW_OUTPUT = 1 |
const int | UPDATE_MODEL = 1 |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.MlModule.StatModel | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Package Functions inherited from OpenCVForUnity.MlModule.StatModel | |
Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm | |
Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Artificial Neural Networks - Multi-Layer Perceptrons.
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.
|
static |
|
static |
Creates empty model.
Use StatModel.train to train the model, Algorithm::load<ANN_MLP>(filename) to load the pre-trained model. Note that the train method has optional flags: ANN_MLP::TrainFlags.
|
protectedvirtual |
Reimplemented from OpenCVForUnity.CoreModule.Algorithm.
double OpenCVForUnity.MlModule.ANN_MLP.getAnnealCoolingRatio | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getAnnealFinalT | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getAnnealInitialT | ( | ) |
int OpenCVForUnity.MlModule.ANN_MLP.getAnnealItePerStep | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getBackpropMomentumScale | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getBackpropWeightScale | ( | ) |
Mat OpenCVForUnity.MlModule.ANN_MLP.getLayerSizes | ( | ) |
Integer vector specifying the number of neurons in each layer including the input and output layers. The very first element specifies the number of elements in the input layer. The last element - number of elements in the output layer.
double OpenCVForUnity.MlModule.ANN_MLP.getRpropDW0 | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getRpropDWMax | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getRpropDWMin | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getRpropDWMinus | ( | ) |
double OpenCVForUnity.MlModule.ANN_MLP.getRpropDWPlus | ( | ) |
TermCriteria OpenCVForUnity.MlModule.ANN_MLP.getTermCriteria | ( | ) |
double double double epsilon OpenCVForUnity.MlModule.ANN_MLP.getTermCriteriaAsValueTuple | ( | ) |
Vec3d OpenCVForUnity.MlModule.ANN_MLP.getTermCriteriaAsVec3d | ( | ) |
int OpenCVForUnity.MlModule.ANN_MLP.getTrainMethod | ( | ) |
Returns current training method
Mat OpenCVForUnity.MlModule.ANN_MLP.getWeights | ( | int | layerIdx | ) |
|
static |
Loads and creates a serialized ANN from a file.
Use ANN::save to serialize and store an ANN to disk. Load the ANN from this file again, by calling this function with the path to the file.
filepath | path to serialized ANN |
void OpenCVForUnity.MlModule.ANN_MLP.setActivationFunction | ( | int | type | ) |
Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP.SIGMOID_SYM.
type | The type of activation function. See ANN_MLP::ActivationFunctions. |
param1 | The first parameter of the activation function, \(\alpha\). Default value is 0. |
param2 | The second parameter of the activation function, \(\beta\). Default value is 0. |
void OpenCVForUnity.MlModule.ANN_MLP.setActivationFunction | ( | int | type, |
double | param1 ) |
Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP.SIGMOID_SYM.
type | The type of activation function. See ANN_MLP::ActivationFunctions. |
param1 | The first parameter of the activation function, \(\alpha\). Default value is 0. |
param2 | The second parameter of the activation function, \(\beta\). Default value is 0. |
void OpenCVForUnity.MlModule.ANN_MLP.setActivationFunction | ( | int | type, |
double | param1, | ||
double | param2 ) |
Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP.SIGMOID_SYM.
type | The type of activation function. See ANN_MLP::ActivationFunctions. |
param1 | The first parameter of the activation function, \(\alpha\). Default value is 0. |
param2 | The second parameter of the activation function, \(\beta\). Default value is 0. |
void OpenCVForUnity.MlModule.ANN_MLP.setAnnealCoolingRatio | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setAnnealFinalT | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setAnnealInitialT | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setAnnealItePerStep | ( | int | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setBackpropMomentumScale | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setBackpropWeightScale | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setLayerSizes | ( | Mat | _layer_sizes | ) |
Integer vector specifying the number of neurons in each layer including the input and output layers. The very first element specifies the number of elements in the input layer. The last element - number of elements in the output layer. Default value is empty Mat.
void OpenCVForUnity.MlModule.ANN_MLP.setRpropDW0 | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setRpropDWMax | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setRpropDWMin | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setRpropDWMinus | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setRpropDWPlus | ( | double | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setTermCriteria | ( | in Vec3d | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setTermCriteria | ( | in(double type, double maxCount, double epsilon) | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setTermCriteria | ( | TermCriteria | val | ) |
void OpenCVForUnity.MlModule.ANN_MLP.setTrainMethod | ( | int | method | ) |
Sets training method and common parameters.
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.BACKPROP and to initialT for ANN_MLP.ANNEAL. |
param2 | passed to setRpropDWMin for ANN_MLP.RPROP and to setBackpropMomentumScale for ANN_MLP.BACKPROP and to finalT for ANN_MLP.ANNEAL. |
void OpenCVForUnity.MlModule.ANN_MLP.setTrainMethod | ( | int | method, |
double | param1 ) |
Sets training method and common parameters.
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.BACKPROP and to initialT for ANN_MLP.ANNEAL. |
param2 | passed to setRpropDWMin for ANN_MLP.RPROP and to setBackpropMomentumScale for ANN_MLP.BACKPROP and to finalT for ANN_MLP.ANNEAL. |
void OpenCVForUnity.MlModule.ANN_MLP.setTrainMethod | ( | int | method, |
double | param1, | ||
double | param2 ) |
Sets training method and common parameters.
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.BACKPROP and to initialT for ANN_MLP.ANNEAL. |
param2 | passed to setRpropDWMin for ANN_MLP.RPROP and to setBackpropMomentumScale for ANN_MLP.BACKPROP and to finalT for ANN_MLP.ANNEAL. |
|
static |
|
static |
|
static |
|
static |
|
static |
double double OpenCVForUnity.MlModule.ANN_MLP.maxCount |
|
static |
|
static |
|
static |
|
static |
|
static |
double OpenCVForUnity.MlModule.ANN_MLP.type |
|
static |