class_docstr: Trainer for Seq2Reward
class_docstr_tok: ["Trainer","for","Seq2Reward"]
code: def __init__(
      self,
      seq2reward_network: Seq2RewardNetwork,
      params: Seq2RewardTrainerParameters,
  ):
      super().__init__()
      self.seq2reward_network = seq2reward_network
      self.params = params
  
      # Turning off Q value output during training:
      self.view_q_value = params.view_q_value
      # permutations used to do planning
      self.all_permut = gen_permutations(
          params.multi_steps, len(self.params.action_names)
      )
      self.mse_loss = nn.MSELoss(reduction="mean")
  
      # Predict how many steps are remaining from the current step
      self.step_predict_network = FullyConnectedNetwork(
          [
              self.seq2reward_network.state_dim,
              self.params.step_predict_net_size,
              self.params.step_predict_net_size,
              self.params.multi_steps,
          ],
          ["relu", "relu", "linear"],
          use_layer_norm=False,
      )
      self.step_loss = nn.CrossEntropyLoss(reduction="mean")
  
imports: import logging
  import reagent.core.types
  import torch
  import torch.nn
  import torch.nn.functional
  from reagent.core.parameters import Seq2RewardTrainerParameters
  from reagent.models.fully_connected_network import FullyConnectedNetwork
  from reagent.models.seq2reward_model import Seq2RewardNetwork
  from reagent.training.reagent_lightning_module import ReAgentLightningModule
  from reagent.training.utils import gen_permutations
label_desc: Use image node_id 1 to create a new Seq2RewardTrainer object from inherited base classes: ReAgentLightningModule with example: obj = Seq2RewardTrainer(seq2reward_network, params)