F_VN_CreateStaModelExp2

F_VN_CreateStaModelExp2 1:

Create a Simplified TopoART neural network of the specified type. The initial reference count is set to one if a new model is created and kept, otherwise. Models of this type support on-line training (sample by sample), retraining, as well as scalar and vectorial predictions. It requires all input except class labels (i.e., samples and training outputs/predictions) to lie in the interval [0.0, 1.0]. The predictions of regressors need to be rescaled from the interval [0.0, 1.0] to their respective value range before usage. Depending on the parameter settings and the number of available training samples, repeated training with the same data may improve the results. Like other neural networks based on the Adaptive Resonance Theory (ART), Simplified TopoART neural networks are not prone to catastrophic inference and patricularly well-suited to incremental learning tasks. (additional expert function providing parameters for fine-tuning and noise reduction)

Syntax

Definition:

FUNCTION F_VN_CreateStaModelExp2 : HRESULT
VAR_INPUT
    ipMlModel        : Reference To ITcVnMlModel;
    eStaType         : ETcVnSta;
    fRho             : LREAL;
    nNu              : UDINT;
    bDoublePrecision : BOOL;
    fBetaSbm         : LREAL;
    nPhi             : UDINT;
    nTau             : UDINT;
    hrPrev           : HRESULT;
END_VAR

F_VN_CreateStaModelExp2 2: Inputs

Name

Type

Description

ipMlModel

Reference To ITcVnMlModel

Returns the created model (Non-zero interface pointers are reused.)

eStaType

ETcVnSta

Simpified TopoART model type

fRho

LREAL

Vigilance parameter (controls the number of neurons that are inserted and the maximum size of the formed categories; valid range: [0.0, 1.0]; suggested range: [0.8, 1.0))

nNu

UDINT

Number of neurons used for classification and prediction (must be larger than or equal to 1; suggested range: [1, 10); default: 3)

bDoublePrecision

BOOL

If true, the model is generated with double precision (LREAL) instead of single precision (REAL). (default: FALSE)

fBetaSbm

LREAL

Learning rate of the second best-matching neuron (learning the second best-matching neuron keeps related categories closer together and might improve the results but may require a higher number of neurons and training runs; a value of 0.0 disables learning of the second best-matching neuron; valid range: [0.0, 1.0]; suggested range: [0.0, 0.5]); default: 0.0

nPhi

UDINT

Number of samples a neuron must have learnt to become permanent (required for noise reduction; works in conjunction with nTau; must be larger than or equal to 1; higher values intensify noise reduction; a value of 1 disables removal of neuron candidates; default: 1)

nTau

UDINT

Number of learning steps after which node removal is performed (required for noise reduction; works in conjunction with nPhi; must be large enough to allow neuron candidates representing non-noise samples to become the best-matching neuron at least nPhi times before node removal; default: 100)

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_CreateStaModelExp2 3: Return value

HRESULT

Further information

The function F_VN_CreateStaModelExp2 is an expert variant of F_VN_CreateStaModel. It contains additional parameters.

Parameter

Model

The created model is returned in the interface pointer ipMlModel.

Model type

eStaType specifies whether the STA model is used for classification (TCVN_STA_CLASSIFIER), regression (TCVN_STA_REGRESSOR), clustering (TCVN_STA_CLUSTERER) or anomaly detection (TCVN_STA_NOVELTY_DETECTOR).

Vigilance parameters

This parameter is crucial for adapting the model to the respective task, as it controls the maximum size of the sub-areas to be learned.

Number of neighbors used

nNu specifies the number of neighboring sub-areas used for classification and prediction and must be >= 1.

Higher accuracy

If bDoublePrecision is TRUE, LREAL is used as the data type for the internal calculations of the model; if it is FALSE, REAL is used.

Adjustment of the distribution

fBetaSbm supplements the control for adapting the sub-areas to the underlying sample distribution.

Noise suppression

nPhi and nTau are used to control the suppression of very rare samples (noise, outliers) in the learning process.

nPhi specifies the number of samples that must be learned in a sub-area so that this sub-area is permanently taken into account.

nTau specifies after how many learning steps the condition of nPhi is checked and sub-areas that do not fulfill this condition are removed.

Increasing nPhi and decreasing nTau increases the noise suppression, whereby the ratio of nPhi to nTau can be used as a measure to estimate the strength.

Application

For example, an STA model for classification can be created like this:

hr := F_VN_CreateStaModel(
    ipMlModel        := ipMlModel,
    eStaType         := TCVN_STA_CLASSIFIER,
    fRho             := 0.9,
    nNu              := 3,
    bDoublePrecision := FALSE,
    fBetaSbm         := 0.0,
    nPhi             := 1,
    nTau             := 100,
    hrPrev           := hr);

Required License

TC3 Vision Machine Learning

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision