add_sample_class_mlpT_add_sample_class_mlpAddSampleClassMlpAddSampleClassMlp (Operator)


add_sample_class_mlpT_add_sample_class_mlpAddSampleClassMlpAddSampleClassMlp — Add a training sample to the training data of a multilayer perceptron.


add_sample_class_mlp( : : MLPHandle, Features, Target : )

Herror T_add_sample_class_mlp(const Htuple MLPHandle, const Htuple Features, const Htuple Target)

void AddSampleClassMlp(const HTuple& MLPHandle, const HTuple& Features, const HTuple& Target)

void HClassMlp::AddSampleClassMlp(const HTuple& Features, const HTuple& Target) const

void HClassMlp::AddSampleClassMlp(const HTuple& Features, Hlong Target) const

static void HOperatorSet.AddSampleClassMlp(HTuple MLPHandle, HTuple features, HTuple target)

void HClassMlp.AddSampleClassMlp(HTuple features, HTuple target)

void HClassMlp.AddSampleClassMlp(HTuple features, int target)


add_sample_class_mlpadd_sample_class_mlpAddSampleClassMlpAddSampleClassMlpAddSampleClassMlp adds a training sample to the multilayer perceptron (MLP) given by MLPHandleMLPHandleMLPHandleMLPHandleMLPHandle. The training sample is given by FeaturesFeaturesFeaturesFeaturesfeatures and TargetTargetTargetTargettarget. FeaturesFeaturesFeaturesFeaturesfeatures is the feature vector of the sample, and consequently must be a real vector of length NumInput, as specified in create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlp. TargetTargetTargetTargettarget is the target vector of the sample, which must have the length NumOutput (see create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlp) for all three types of activation functions of the MLP (exception: see below). If the MLP is used for regression (function approximation), i.e., if OutputFunction = 'linear'"linear""linear""linear""linear", TargetTargetTargetTargettarget is the value of the function at the coordinate FeaturesFeaturesFeaturesFeaturesfeatures. In this case, TargetTargetTargetTargettarget can contain arbitrary real numbers. For OutputFunction = 'logistic'"logistic""logistic""logistic""logistic", TargetTargetTargetTargettarget can only contain the values 0.0 and 1.0. A value of 1.0 specifies that the attribute in question is present, while a value of 0.0 specifies that the attribute is absent. Because in this case the attributes are independent, arbitrary combinations of 0.0 and 1.0 can be passed. For OutputFunction = 'softmax'"softmax""softmax""softmax""softmax", TargetTargetTargetTargettarget also can only contain the values 0.0 and 1.0. In contrast to OutputFunction = 'logistic'"logistic""logistic""logistic""logistic", the value 1.0 must be present for exactly one element of the tuple TargetTargetTargetTargettarget. The location in the tuple designates the class of the sample. For ease of use, a single integer value may be passed if OutputFunction = 'softmax'"softmax""softmax""softmax""softmax". This value directly designates the class of the sample, which is counted from 0, i.e., the class must be an integer between 0 and NumOutput - 1. The class is converted to a target vector of length NumOutput internally.

Before the MLP can be trained with train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlp, all training samples must be added to the MLP with add_sample_class_mlpadd_sample_class_mlpAddSampleClassMlpAddSampleClassMlpAddSampleClassMlp.

The number of currently stored training samples can be queried with get_sample_num_class_mlpget_sample_num_class_mlpGetSampleNumClassMlpGetSampleNumClassMlpGetSampleNumClassMlp. Stored training samples can be read out again with get_sample_class_mlpget_sample_class_mlpGetSampleClassMlpGetSampleClassMlpGetSampleClassMlp.

Normally, it is useful to save the training samples in a file with write_samples_class_mlpwrite_samples_class_mlpWriteSamplesClassMlpWriteSamplesClassMlpWriteSamplesClassMlp to facilitate reusing the samples, and to facilitate that, if necessary, new training samples can be added to the data set, and hence to facilitate that a newly created MLP can be trained anew with the extended data set.

Execution Information

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.


MLPHandleMLPHandleMLPHandleMLPHandleMLPHandle (input_control, state is modified)  class_mlp HClassMlp, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

MLP handle.

FeaturesFeaturesFeaturesFeaturesfeatures (input_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Feature vector of the training sample to be stored.

TargetTargetTargetTargettarget (input_control)  number(-array) HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Class or target vector of the training sample to be stored.


If the parameters are valid, the operator add_sample_class_mlpadd_sample_class_mlpAddSampleClassMlpAddSampleClassMlpAddSampleClassMlp returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors


Possible Successors

train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlp, write_samples_class_mlpwrite_samples_class_mlpWriteSamplesClassMlpWriteSamplesClassMlpWriteSamplesClassMlp



See also

clear_samples_class_mlpclear_samples_class_mlpClearSamplesClassMlpClearSamplesClassMlpClearSamplesClassMlp, get_sample_num_class_mlpget_sample_num_class_mlpGetSampleNumClassMlpGetSampleNumClassMlpGetSampleNumClassMlp, get_sample_class_mlpget_sample_class_mlpGetSampleClassMlpGetSampleClassMlpGetSampleClassMlp