code: def __init__(
      self,
      reward_net: ModelBase,
      optimizer: Optimizer__Union = field(  # noqa: B008
          default_factory=Optimizer__Union.default
      ),
      loss_type: LossFunction = LossFunction.MSE,
      reward_ignore_threshold: Optional[float] = None,
      weighted_by_inverse_propensity: bool = False,
  ) -> None:
      super().__init__()
      self.reward_net = reward_net
      self.optimizer = optimizer
      self.loss_type = loss_type
      self.reward_ignore_threshold = reward_ignore_threshold
      self.weighted_by_inverse_propensity = (
          weighted_by_inverse_propensity
      )
      self.loss_fn = _get_loss_function(
          loss_type,
          reward_ignore_threshold,
          weighted_by_inverse_propensity,
      )
  
imports: import logging
  from enum import Enum
  from typing import Optional
  import numpy
  import reagent.core.types
  import torch
  from reagent.core.dataclasses import field
  from reagent.models.base import ModelBase
  from reagent.optimizer.union import Optimizer__Union
  from reagent.training.reagent_lightning_module import ReAgentLightningModule
label_desc: Use image node_id 1 to create a new RewardNetTrainer object from inherited base classes: ReAgentLightningModule with example: obj = RewardNetTrainer(reward_net, optimizer, loss_type, reward_ignore_threshold, weighted_by_inverse_propensity)