class_docstr: Sandwich Model
  
  Parameters
  ----------
  d_feat : int
      input dimension for each time step
  metric: str
      the evaluation metric used in early stop
  optimizer : str
      optimizer name
  GPU : str
      the GPU ID(s) used for training
code: def loss_fn(self, pred, label):
      mask = ~torch.isnan(label)
  
      if self.loss == "mse":
          return self.mse(pred[mask], label[mask])
  
      raise ValueError("unknown loss `%s`" % self.loss)
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import pandas
  from typing import Text, Union
  import copy
  from ...utils import get_or_create_path
  from ...log import get_module_logger
  import torch
  import torch.nn
  import torch.optim
  from ...model.base import Model
  from ...data.dataset import DatasetH
  from ...data.dataset.handler import DataHandlerLP
  from .pytorch_krnn import CNNKRNNEncoder
label_desc: Use image node_id 4 for calling the Sandwich obj's underlying member method code with example usage: obj.loss_fn(pred, label) and returns: self