code: def __init__(
      self,
      task,
      eps,
      r3f_lambda,
      noise_type,
      classification_head_name,
      regression_target,
  ):
      super().__init__(task)
      self.eps = eps
      self.r3f_lambda = r3f_lambda
      self.noise_type = noise_type
      self.classification_head_name = classification_head_name
      self.regression_target = regression_target
      if self.noise_type in {"normal"}:
          self.noise_sampler = torch.distributions.normal.Normal(
              loc=0.0, scale=self.eps
          )
      elif self.noise_type == "uniform":
          self.noise_sampler = torch.distributions.uniform.Uniform(
              low=-self.eps, high=self.eps
          )
      else:
          raise Exception(f"unrecognized noise type {self.noise_type}")
  
file_path: fairseq/examples/rxf/rxf_src/sentence_prediction_r3f.py
imports: import math
  import torch
  import torch.nn.functional
  from fairseq import utils
  from fairseq.criterions import FairseqCriterion, register_criterion
label_desc: Use image node_id 1 to create a new SentencePredictionR3F object from inherited base classes: FairseqCriterion with example: obj = SentencePredictionR3F(task, eps, r3f_lambda, noise_type, classification_head_name, regression_target)