class_docstr: Implements "A General Theoretical Paradigm
  to Understand Learning from Human Preferences"
  from https://arxiv.org/pdf/2310.12036.pdf
class_docstr_tok: ["Implements","``","A","General","Theoretical","Paradigm","to","Understand","Learning","from","Human","Preferences","''","from","https",":","\/\/arxiv.org\/pdf\/2310.12036.pdf"]
code: def get_losses(self, logits):
      # eqn (17) of the https://arxiv.org/pdf/2310.12036.pdf
      # where beta is the real, positive KL parameter for the IPO loss,
      # denoted by tau in the paper (see also eqn (6)).
      losses = (logits - 1 / (2 * self.cfg.training.beta)) ** 2
      return losses
  
file_path: h2o-llmstudio/llm_studio/src/losses/text_dpo_modeling_losses.py
imports: import logging
  from typing import Any, KeysView, Tuple
  import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 1 for calling the IPOLoss obj's underlying member method code with example usage: obj.get_losses(logits) and returns: losses