Welcome to our Support Center



Computes the categorical hinge loss between y_true and y_pred.​ Type : polymorphic.




Input parameters


CategoricalHinge in : class
reduction : enum, type of reduction to apply to the loss. In almost all cases this should be “Sum over Batch“.


Output parameters


CategoricalHinge out : class

Required data

Β y_pred :Β array,Β predicted values (one hot probabilities for example, [0.1, 0.3, 0.6] for 3-class problem).
Β y_true :Β array,Β true values (one hot for example, [0, 0, 1] for 3-class problem).

Use cases

Categorical hinge loss is a loss function primarily used in multiclass classification problems. Similar to the hinge loss used in binary classification tasks, it is adapted to handle multiple classes.

This function compares the correct prediction to the highest prediction among the incorrect classes. It is often used in models that require a decision margin, such as certain types of Support Vector Machine (SVM) networks.


All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install HAIBAL library to run it).

Table of Contents