Operator Reference

set_rejection_params_class_mlpT_set_rejection_params_class_mlpSetRejectionParamsClassMlpSetRejectionParamsClassMlpset_rejection_params_class_mlp (Operator)

set_rejection_params_class_mlpT_set_rejection_params_class_mlpSetRejectionParamsClassMlpSetRejectionParamsClassMlpset_rejection_params_class_mlp — Set the parameters of a rejection class.

Signature

set_rejection_params_class_mlp( : : MLPHandle, GenParamName, GenParamValue : )

Herror T_set_rejection_params_class_mlp(const Htuple MLPHandle, const Htuple GenParamName, const Htuple GenParamValue)

void SetRejectionParamsClassMlp(const HTuple& MLPHandle, const HTuple& GenParamName, const HTuple& GenParamValue)

void HClassMlp::SetRejectionParamsClassMlp(const HTuple& GenParamName, const HTuple& GenParamValue) const

void HClassMlp::SetRejectionParamsClassMlp(const HString& GenParamName, const HString& GenParamValue) const

void HClassMlp::SetRejectionParamsClassMlp(const char* GenParamName, const char* GenParamValue) const

void HClassMlp::SetRejectionParamsClassMlp(const wchar_t* GenParamName, const wchar_t* GenParamValue) const   ( Windows only)

static void HOperatorSet.SetRejectionParamsClassMlp(HTuple MLPHandle, HTuple genParamName, HTuple genParamValue)

void HClassMlp.SetRejectionParamsClassMlp(HTuple genParamName, HTuple genParamValue)

void HClassMlp.SetRejectionParamsClassMlp(string genParamName, string genParamValue)

def set_rejection_params_class_mlp(mlphandle: HHandle, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, float, int]]) -> None

Description

set_rejection_params_class_mlpset_rejection_params_class_mlpSetRejectionParamsClassMlpSetRejectionParamsClassMlpset_rejection_params_class_mlp sets the parameters of an automatically generated rejection class inside of a multilayer perceptron (MLP) given by MLPHandleMLPHandleMLPHandleMLPHandlemlphandle. In some applications, it is desirable to know whether a feature vector is similar to one of the training set. If a feature vector lies outside of the provided training set, it should be classified as a special rejection class. This means that the feature vector is different to the confidence area of the classifier. If a rejection class should be created automatically, an additional class must be specified while creating the classifier in create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpcreate_class_mlp. Here, the parameter NumOutputNumOutputNumOutputnumOutputnum_output must be increased by one.

The parameters of the rejection class are selected with GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and the respective values with GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

'rejection_class_index'"rejection_class_index""rejection_class_index""rejection_class_index""rejection_class_index":

By default, the last class serves as the rejection class. If another class should be used, GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name must be set to 'rejection_class_index'"rejection_class_index""rejection_class_index""rejection_class_index""rejection_class_index" and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value to the class index.

'sampling_strategy'"sampling_strategy""sampling_strategy""sampling_strategy""sampling_strategy":

Currently, three strategies exist to generate samples for the rejection class during the training of the MLP. These strategies can be selected by setting GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name to 'sampling_strategy'"sampling_strategy""sampling_strategy""sampling_strategy""sampling_strategy" and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value to 'hyperbox_around_all_classes'"hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes", 'hyperbox_around_each_class'"hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class", or 'hyperbox_ring_around_each_class'"hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class". The sampling strategy 'hyperbox_around_all_classes'"hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes" takes the bounding box of all training samples that have been provided so far. The sampling strategy 'hyperbox_around_each_class'"hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class" is similar with the only difference that the bounding box around each class is taken as the area where the rejection samples are generated. The sampling strategy 'hyperbox_ring_around_each_class'"hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class" generates samples only in the enlarged areas around the bounding box of each class, thus generating a hyperbox ring around the original samples. Please note that with increasing dimensionality the sampling strategies 'hyperbox_around_each_class'"hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class" and 'hyperbox_ring_around_each_class'"hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class" provide the same result. If no rejection class sampling strategy should be used, which is the default, GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value must be set to 'no_rejection_class'"no_rejection_class""no_rejection_class""no_rejection_class""no_rejection_class".

'hyperbox_tolerance'"hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance":

The factor 'hyperbox_tolerance'"hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance" describes by what amount the bounding box should be enlarged in all dimensions. Then, inside this box samples are randomly generated from a uniform distribution. The default value is 0.2.

'rejection_sample_factor'"rejection_sample_factor""rejection_sample_factor""rejection_sample_factor""rejection_sample_factor":

The number of rejection samples is the number of provided samples multiplied by 'rejection_sample_factor'"rejection_sample_factor""rejection_sample_factor""rejection_sample_factor""rejection_sample_factor". If not enough samples are generated, the rejection class may not be classified correctly. If the rejection class has too many samples, the normal classes are classified as rejection class. The default value is 1.0. Note that the training time will increase by a factor of , where is the value of 'rejection_sample_factor'"rejection_sample_factor""rejection_sample_factor""rejection_sample_factor""rejection_sample_factor".

'random_seed'"random_seed""random_seed""random_seed""random_seed":

To ensure reproducible results, a random seed can be set with 'random_seed'"random_seed""random_seed""random_seed""random_seed". The default value is 42.

Because this operator only parametrizes the training of the MLP, the values are not saved by write_class_mlpwrite_class_mlpWriteClassMlpWriteClassMlpwrite_class_mlp.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

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.

Parameters

MLPHandleMLPHandleMLPHandleMLPHandlemlphandle (input_control, state is modified)  class_mlp HClassMlp, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

MLP handle.

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Names of the generic parameters.

Default: 'sampling_strategy' "sampling_strategy" "sampling_strategy" "sampling_strategy" "sampling_strategy"

List of values: 'hyperbox_tolerance'"hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance""hyperbox_tolerance", 'random_seed'"random_seed""random_seed""random_seed""random_seed", 'rejection_class_index'"rejection_class_index""rejection_class_index""rejection_class_index""rejection_class_index", 'rejection_sample_factor'"rejection_sample_factor""rejection_sample_factor""rejection_sample_factor""rejection_sample_factor", 'sampling_strategy'"sampling_strategy""sampling_strategy""sampling_strategy""sampling_strategy"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  string(-array) HTupleMaybeSequence[Union[str, float, int]]HTupleHtuple (string / real / integer) (string / double / int / long) (HString / double / Hlong) (char* / double / Hlong)

Values of the generic parameters.

Default: 'hyperbox_around_all_classes' "hyperbox_around_all_classes" "hyperbox_around_all_classes" "hyperbox_around_all_classes" "hyperbox_around_all_classes"

List of values: 'hyperbox_around_all_classes'"hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes""hyperbox_around_all_classes", 'hyperbox_around_each_class'"hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class""hyperbox_around_each_class", 'hyperbox_ring_around_each_class'"hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class""hyperbox_ring_around_each_class", 'no_rejection_class'"no_rejection_class""no_rejection_class""no_rejection_class""no_rejection_class"

Result

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

Possible Predecessors

create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpcreate_class_mlp

Possible Successors

train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlptrain_class_mlp

Module

Foundation