Class ANN_MLP
Artificial Neural Networks - Multi-Layer Perceptrons.
Implements
Inherited Members
Namespace: OpenCvSharp.ML
Assembly: OpenCvSharp.dll
Syntax
public class ANN_MLP : StatModel, ICvPtrHolder
Constructors
| Improve this Doc View SourceANN_MLP(IntPtr)
Creates instance by raw pointer cv::ml::ANN_MLP*
Declaration
protected ANN_MLP(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | p |
Properties
| Improve this Doc View SourceBackpropMomentumScale
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. Default value is 0.1.
Declaration
public double BackpropMomentumScale { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
BackpropWeightScale
Strength of the weight gradient term. The recommended value is about 0.1. Default value is 0.1.
Declaration
public double BackpropWeightScale { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RpropDW0
Initial value Delta_0 of update-values Delta_{ij}. Default value is 0.1.
Declaration
public double RpropDW0 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RpropDWMax
Update-values upper limit Delta_{max}. It must be >1. Default value is 50.
Declaration
public double RpropDWMax { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RpropDWMin
Update-values lower limit Delta_{min}. It must be positive. Default value is FLT_EPSILON.
Declaration
public double RpropDWMin { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RpropDWMinus
Decrease factor eta^-. It must be >1. Default value is 0.5.
Declaration
public double RpropDWMinus { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
RpropDWPlus
Increase factor eta^+. It must be >1. Default value is 1.2.
Declaration
public double RpropDWPlus { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
TermCriteria
Termination criteria of the training algorithm.
Declaration
public TermCriteria TermCriteria { get; set; }
Property Value
Type | Description |
---|---|
OpenCvSharp.TermCriteria |
Methods
| Improve this Doc View SourceCreate()
Creates the empty model.
Declaration
public static ANN_MLP Create()
Returns
Type | Description |
---|---|
ANN_MLP |
DisposeManaged()
Releases managed resources
Declaration
protected override void DisposeManaged()
Overrides
| Improve this Doc View SourceGetLayerSizes()
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.
Declaration
public virtual Mat GetLayerSizes()
Returns
Type | Description |
---|---|
Mat |
GetTrainMethod()
Returns current training method
Declaration
public virtual ANN_MLP.TrainingMethods GetTrainMethod()
Returns
Type | Description |
---|---|
ANN_MLP.TrainingMethods |
Load(String)
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.
Declaration
public static ANN_MLP Load(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | path to serialized ANN |
Returns
Type | Description |
---|---|
ANN_MLP |
LoadFromString(String)
Loads algorithm from a String.
Declaration
public static ANN_MLP LoadFromString(string strModel)
Parameters
Type | Name | Description |
---|---|---|
System.String | strModel | he string variable containing the model you want to load. |
Returns
Type | Description |
---|---|
ANN_MLP |
SetActivationFunction(ANN_MLP.ActivationFunctions, Double, Double)
Initialize the activation function for each neuron. Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.
Declaration
public virtual void SetActivationFunction(ANN_MLP.ActivationFunctions type, double param1 = 0, double param2 = 0)
Parameters
Type | Name | Description |
---|---|---|
ANN_MLP.ActivationFunctions | type | The type of activation function. See ANN_MLP::ActivationFunctions. |
System.Double | param1 | The first parameter of the activation function, \f$\alpha\f$. Default value is 0. |
System.Double | param2 | The second parameter of the activation function, \f$\beta\f$. Default value is 0. |
SetLayerSizes(InputArray)
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.
Declaration
public virtual void SetLayerSizes(InputArray layerSizes)
Parameters
Type | Name | Description |
---|---|---|
InputArray | layerSizes |
SetTrainMethod(ANN_MLP.TrainingMethods, Double, Double)
Sets training method and common parameters.
Declaration
public virtual void SetTrainMethod(ANN_MLP.TrainingMethods method, double param1 = 0, double param2 = 0)
Parameters
Type | Name | Description |
---|---|---|
ANN_MLP.TrainingMethods | method | Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods. |
System.Double | param1 | passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROP and to initialT for ANN_MLP::ANNEAL. |
System.Double | param2 | passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP and to finalT for ANN_MLP::ANNEAL. |