docstr: Create an environment for training a pytorch machine learning model
code: def __init__(
      self,
      model,
      optimizer,
      scheduler,
      loss_criterion,
      device,
      name=None,
      input_encoder=None,
      output_encoder=None,
  ):
      """
      Create an environment for training a pytorch machine learning model
      """
      self.device = device
      self.model = model
      self.optimizer = optimizer
      self.scheduler = scheduler
      self.loss_criterion = loss_criterion
      self.name = name
      self.input_encoder = input_encoder
      self.output_encoder = output_encoder
  
      self.best_model = None
  
file_path: lightwood/lightwood/encoder/categorical/gym.py
imports: import copy
  import time
  import torch
  import numpy
  from lightwood.helpers.torch import LightwoodAutocast
  from lightwood.helpers.log import log
label_desc: Use image node_id 1 to create a new Gym object  with example: obj = Gym(model, optimizer, scheduler, loss_criterion, device, name, input_encoder, output_encoder)