F_VN_TrainSampleClass

F_VN_TrainSampleClass 1:

Train a classifier with a single sample.

Syntax

Definition:

FUNCTION F_VN_TrainSampleClass : HRESULT
VAR_INPUT
    ipClassifier : ITcVnMlModel;
    ipSample     : ITcUnknown;
    nClass       : DINT;
    hrPrev       : HRESULT;
END_VAR

F_VN_TrainSampleClass 2: Inputs

Name

Type

Description

ipClassifier

ITcVnMlModel

Classifier to be used

ipSample

ITcUnknown

Container holding a single input sample (ContainerType_Vector_REAL or ContainerType_Vector_LREAL)

nClass

DINT

Class label to be learnt

hrPrev

HRESULT

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

F_VN_TrainSampleClass 3: Return value

HRESULT

Further information

The function F_VN_TrainSampleClass trains a classifier model with a sample.

Parameter

Classifier model

The previously created classifier model must be transferred to ipClassifier.

Sample

The sample container is transferred to ipSample. The type of container must be ContainerType_Vector_REAL or ContainerType_Vector_LREAL.

Class

The target class for the sample is transferred as nClass.

Application

For example, a classifier model can be trained with single samples as follows:

hr := F_VN_TrainSampleClass(
    ipClassifier    := ipMlModel,
    ipSample        := ipSample,
    nClass          := nClass,
    hrPrev          := hr);

Related functions

Required License

TC3 Machine Learning Realtime Inference

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.59 or later

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

Tc3_Vision