Welcome to our Support Center

Hinge

Description

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

 

 

 

Input parameters

 

Parameters : cluster,

reduction : enum, type of reduction to apply to the loss. In almost all cases this should be “Sum over Batch“.
sample weights : boolean, if enabled, adds an input for weighting each sample individually.

 

Output parameters

 

Loss : cluster, this cluster defines the loss function used for model training.

enum : enum, an enumeration indicating the loss type (e.g., MSE, CrossEntropy, etc.). If enum is set to CustomLoss, the custom class on the right will be used as the loss function. Otherwise, the selected loss will be applied with its default configuration.
 Class : object, a custom loss class instance.

Required data

 y_pred : array, predicted values.
 y_true : array, true values are expected to be -1 or 1. If binary (0 or 1) labels are provided we will convert them to -1 or 1.

Use cases

Hinge loss is a loss function primarily used in binary classification tasks, such as detecting the presence or absence of an object.

This function aims to maximize the margin between prediction categories. It is widely used in Support Vector Machines (SVM) because it pushes the model to not only be correct, but to be confident in its prediction with a clear margin between classes.

Example

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 Deep Learning library to run it).

Table of Contents