code: def train_seq2reward_compress_model(
      training_data, seq2reward_network, learning_rate=0.1, num_epochs=5
  ):
      SEQ_LEN, batch_size, NUM_ACTION = next(
          iter(training_data)
      ).action.float_features.shape
      assert SEQ_LEN == 6 and NUM_ACTION == 2
  
      compress_net_builder = FullyConnected(sizes=[8, 8])
      state_normalization_data = NormalizationData(
          dense_normalization_parameters={
              0: NormalizationParameters(
                  feature_type=DO_NOT_PREPROCESS
              ),
              1: NormalizationParameters(
                  feature_type=DO_NOT_PREPROCESS
              ),
          }
      )
      compress_model_network = compress_net_builder.build_value_network(
          state_normalization_data,
          output_dim=NUM_ACTION,
      )
  
      trainer_param = Seq2RewardTrainerParameters(
          learning_rate=0.0,
          multi_steps=SEQ_LEN,
          action_names=["0", "1"],
          compress_model_learning_rate=learning_rate,
          gamma=1.0,
          view_q_value=True,
      )
  
      trainer = CompressModelTrainer(
          compress_model_network=compress_model_network,
          seq2reward_network=seq2reward_network,
          params=trainer_param,
      )
  
      pl.seed_everything(SEED)
      pl_trainer = pl.Trainer(max_epochs=num_epochs, deterministic=True)
      pl_trainer.fit(trainer, training_data)
  
      return trainer
  
imports: import logging
  import os
  import random
  import unittest
  from typing import Optional
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  from parameterized import parameterized
  from reagent.core import types
  from reagent.core.parameters import NormalizationData, NormalizationParameters, ProblemDomain, Seq2RewardTrainerParameters
  from reagent.gym.envs import Gym
  from reagent.gym.utils import create_df_from_replay_buffer
  from reagent.models.seq2reward_model import Seq2RewardNetwork
  from reagent.net_builder.value.fully_connected import FullyConnected
  from reagent.prediction.predictor_wrapper import FAKE_STATE_ID_LIST_FEATURES, FAKE_STATE_ID_SCORE_LIST_FEATURES, Seq2RewardPlanShortSeqWithPreprocessor, Seq2RewardWithPreprocessor
  from reagent.preprocessing.identify_types import DO_NOT_PREPROCESS
  from reagent.preprocessing.preprocessor import Preprocessor
  from reagent.training.utils import gen_permutations
  from reagent.training.world_model.compress_model_trainer import CompressModelTrainer
  from reagent.training.world_model.seq2reward_trainer import get_Q, Seq2RewardTrainer
  from torch.utils.data import DataLoader
label_desc: Use image node_id 4 for calling a global function with example usage: train_seq2reward_compress_model(training_data, seq2reward_network, learning_rate, num_epochs) and returns: trainer