F_VN_TrainSampleCluster

F_VN_TrainSampleCluster 1:

Train a clusterer with a single sample and return the ID of the cluster the sample has been assigned to, if requested. The clusterer must be online trainable.

Syntax

Definition:

FUNCTION F_VN_TrainSampleCluster : HRESULT
VAR_INPUT
    ipClusterer : ITcVnMlModel;
    ipSample    : ITcUnknown;
    nCluster    : Reference To DINT;
    hrPrev      : HRESULT;
END_VAR

F_VN_TrainSampleCluster 2: Inputs

Name

Type

Description

ipClusterer

ITcVnMlModel

Clusterer to be used

ipSample

ITcUnknown

Container holding a single input sample (ContainerType_Vector_REAL or ContainerType_Vector_LREAL)

nCluster

Reference To DINT

Returns the ID of the cluster the sample has been assigned to (If the pointer is 0, no cluster ID is requested.)

hrPrev

HRESULT

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

F_VN_TrainSampleCluster 3: Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_TrainSampleCluster trainiert ein Clusterer-Modell mit einem Sample und gibt die zugehörige Cluster ID des Samples zurück.

Parameter

Clusterer-Modell

Das zuvor erstellte Clusterer-Modell muss an ipClusterer übergeben werden.

Sample

Der Sample-Container wird als ipSample übergeben. Der Typ des Containers muss ContainerType_Vector_REAL oder ContainerType_Vector_LREAL sein.

Cluster

Die zum Sample zugehörige Cluster ID wird über nCluster zurückgegeben.

Anwendung

Ein Clusterer-Modell kann z.B. mit einem einzelnen Sample wie folgt trainiert werden:

hr := F_VN_TrainSampleCluster(
    ipClusterer     := ipClusterModel,
    ipSample        := ipSample,
    nCluster        := nCluster,
    hrPrev          := hr);

Verwandte Funktionen

Required License

TC3 Vision Machine Learning

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

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

Tc3_Vision