Show / Hide Table of Contents

Class ANN_MLP

Artificial Neural Networks - Multi-Layer Perceptrons.

Inheritance
System.Object
DisposableObject
DisposableCvObject
Algorithm
StatModel
ANN_MLP
Implements
ICvPtrHolder
Inherited Members
StatModel.GetVarCount()
StatModel.Empty()
StatModel.IsTrained()
StatModel.IsClassifier()
StatModel.Train(TrainData, Int32)
StatModel.Train(InputArray, SampleTypes, InputArray)
StatModel.CalcError(TrainData, Boolean, OutputArray)
StatModel.Predict(InputArray, OutputArray, StatModel.Flags)
Algorithm.Write(FileStorage)
Algorithm.Read(FileNode)
Algorithm.Save(String)
Algorithm.GetDefaultName()
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp.ML
Assembly: OpenCvSharp.dll
Syntax
public class ANN_MLP : StatModel, ICvPtrHolder

Constructors

| Improve this Doc View Source

ANN_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 Source

BackpropMomentumScale

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

TermCriteria

Termination criteria of the training algorithm.

Declaration
public TermCriteria TermCriteria { get; set; }
Property Value
Type Description
OpenCvSharp.TermCriteria

Methods

| Improve this Doc View Source

Create()

Creates the empty model.

Declaration
public static ANN_MLP Create()
Returns
Type Description
ANN_MLP
| Improve this Doc View Source

DisposeManaged()

Releases managed resources

Declaration
protected override void DisposeManaged()
Overrides
DisposableObject.DisposeManaged()
| Improve this Doc View Source

DisposeUnmanaged()

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

Get()

Declaration
public override IntPtr Get()
Returns
Type Description
IntPtr
| Improve this Doc View Source

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.

Declaration
public virtual Mat GetLayerSizes()
Returns
Type Description
Mat
| Improve this Doc View Source

GetTrainMethod()

Returns current training method

Declaration
public virtual ANN_MLP.TrainingMethods GetTrainMethod()
Returns
Type Description
ANN_MLP.TrainingMethods
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX