class_docstr: Mixin class for applying the R3F method, to apply R3F with any model
  inherit the class and implement the abstract functions.
  
  For more details: https://arxiv.org/abs/2008.03156
class_docstr_tok: ["Mixin","class","for","applying","the","R3F","method",",","to","apply","R3F","with","any","model","inherit","the","class","and","implement","the","abstract","functions",".","For","more","details",":","https",":","\/\/arxiv.org\/abs\/2008.03156"]
code: def __init__(self, config: R3FConfigOptions):
      self.r3f_lambda_by_loss = config.r3f_lambda_by_loss
      self.r3f_default_lambda = config.r3f_default_lambda
      self.r3f_eps = config.eps
      self.noise_sampler = build_noise_sampler(
          config.noise_type, self.r3f_eps
      )
  
imports: from contextlib import AbstractContextManager
  from enum import Enum
  from typing import Dict
  import torch
  import torch.nn.functional
  from pytext.common.constants import Stage
  from pytext.config import ConfigBase
  from pytext.utils.precision import maybe_float
label_desc: Use image node_id 1 to create a new R3FPyTextMixin object from inherited base classes: object with example: obj = R3FPyTextMixin(config)