How to use the max margin loss?

username: Rafael_R
cooked: <p>How to use the [max margin loss]<img src="https://discuss.pytorch.org/images/emoji/apple/frowning.png?v=9" title=":frowning:" class="emoji" alt=":frowning:"><a href="https://pytorch.org/docs/stable/nn.html#torch.nn.MarginRankingLoss" rel="nofollow noopener">https://pytorch.org/docs/stable/nn.html#torch.nn.MarginRankingLoss</a>):</p>
<p>The inputs are expected to be distances or the loss function computes the distances between x1 and x2?</p>
<p>E.g. x1 and x2 should be tensors or scalar values?</p>

username: Jesse_Stone
cooked: <p>try to Learn<br>
[Hinge Loss]<br>
[support vector machine]</p><aside class="onebox wikipedia" data-onebox-src="https://en.wikipedia.org/wiki/Hinge_loss">
  <header class="source">

      <a href="https://en.wikipedia.org/wiki/Hinge_loss" target="_blank" rel="noopener nofollow ugc">en.wikipedia.org</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:220/165;"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Hinge_loss_vs_zero_one_loss.svg/220px-Hinge_loss_vs_zero_one_loss.svg.png" class="thumbnail" width="220" height="165"></div>

<h3><a href="https://en.wikipedia.org/wiki/Hinge_loss" target="_blank" rel="noopener nofollow ugc">Hinge loss</a></h3>

<p>In machine learning, the hinge loss is a loss function used for training classifiers. The hinge loss is used for "maximum-margin" classification, most notably for support vector machines (SVMs).
 For an intended output t = ±1 and a classifier score y, the hinge loss of the prediction y is defined as
 Note that 
  
    
      
        y
      
    
    {\displaystyle y}
  
 should be the "raw" output of the classifier's decision function, not the predicted class label. For instance, in linear SVMs...</p>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://programmathically.com/understanding-hinge-loss-and-the-svm-cost-function/">
  <header class="source">
      <img src="https://programmathically.com/wp-content/uploads/2021/03/cropped-programmathically-1-32x32.jpg" class="site-icon" width="32" height="32">

      <a href="https://programmathically.com/understanding-hinge-loss-and-the-svm-cost-function/" target="_blank" rel="noopener nofollow ugc" title="08:24AM - 22 August 2021">Programmathically - A Blog on Building Machine Learning Solutions – 22 Aug 21</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/230;"><img src="https://programmathically.com/wp-content/uploads/2021/03/programmathically-1.jpg" class="thumbnail" width="690" height="230"></div>

<h3><a href="https://programmathically.com/understanding-hinge-loss-and-the-svm-cost-function/" target="_blank" rel="noopener nofollow ugc">Understanding Hinge Loss and the SVM Cost Function - Programmathically</a></h3>

  <p>Sharing is caringTweetIn this post, we develop an understanding of the hinge loss and how it is used in the cost function of support vector machines. Hinge Loss The hinge loss is a specific type of cost function that incorporates a margin or distance...</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>