Questions tagged [hinge-loss]

The hinge loss function is defined as $l(y, t) = max(0, 1 - t \cdot y)$

The hinge loss function $\mathcal{l}$ is defined as

$$\mathcal{l}(y, t) = \max(0, 1 - t \cdot y)$$

where $t$ is the target value and $y$ is the prediction.

It has values in $[0, \infty)$

See also

9 questions
12
votes
1 answer

What's the relationship between an SVM and hinge loss?

My colleague and I are trying to wrap our heads around the difference between logistic regression and an SVM. Clearly they are optimizing different objective functions. Is an SVM as simple as saying it's a discriminative classifier that simply…
Simon
  • 1,026
  • 10
  • 10
3
votes
2 answers

SVM behavior when regularization parameter equals 0

I read on this Wikipedia page the following about soft-margin SVM: "The parameter $λ$ determines the trade-off between increasing the margin size and ensuring that the $x_i$ lie on the correct side of the margin. Thus, for sufficiently small…
Ben
  • 51
  • 1
3
votes
1 answer

Hinge Loss understanding and proof

I hope this doesn't come off as a silly question, but I am looking at SVMs and in principle I understand how they work. The idea is to maximize the margin between different classes of point (within any dimension) as much as possible. So to…
buydadip
  • 179
  • 7
2
votes
1 answer

how to implement squared hinge loss in pytorch

does anyone have any advice on how to implement this loss in order to use it with a convolutional neural network? Also, how should I encode the labels of my training data? We were using one hot encoding with bce loss before and I was wandering if I…
2
votes
1 answer

How is hinge loss related to primal form / dual form of SVM

I'm learning SVM and many classic tutorials talk about the formulation of SVM problem as a convex optimization problem: i.e. We have the objective function with slack variables and subject to constraints. Most tutorials go through the derivation…
1
vote
0 answers

cs231n : assignment1 Compute the gradient of the loss function and store it dW in SVM Loss

def svm_loss_naive(W, X, y, reg): """ Structured SVM loss function, naive implementation (with loops). Inputs have dimension D, there are C classes, and we operate on minibatches of N examples. Inputs: - W: A numpy array of shape (D,…
Lalit Vyas
  • 191
  • 6
1
vote
1 answer

Why margin-based ranking loss is reversed in these two papers?

For knwoledge graph completion, it is very common to use margin-based ranking loss In the paper:margin-based ranking loss is defined as $$ \min \sum_{(h,l,t)\in S} \sum_{(h',l,t')\in S'}[\gamma + d(h,l,t) - d(h',l,t')]_+$$ Here $d(\cdot)$ is the…
jason
  • 309
  • 2
  • 4
  • 9
0
votes
1 answer

Hinge loss question

Hinge loss is usually defined as $$L(y,\hat{y}) = max(0,1-y\hat{y}) $$ What I don't understand is why are we comparing zero with $1-y\hat{y}$ instead of some other constant. Why not make it $2-y\hat{y}$, or $\sqrt2-y\hat{y}$ or just take…
dmonkoff
  • 13
  • 1
0
votes
0 answers

Correlation between hinge loss function, Langrage function and ai

The function $f(w,b) = \frac{1}{2} ||w||^2$ is our objective function while our constraints are all the correct classifications of the data points expressed as $g(w,b) = \sum_{i=1}^{l} (y_i (x_i \cdot w_i+b)-1)$, where $l$ is the number of data…
eisa.exe
  • 1
  • 1