class_docstr: Hierarchical Attention Network (RNN baseline model)
code: def init_loss(self):
      if self.hparams.loss_type == "robust":
          raise NotImplementedError(
              "Deprecated: use asymmetric loss instead"
          )
      elif self.hparams.loss_type == "asymmetric":
          if self.hparams.encoder_type == "neural":
              self.loss = AsymmetricCrossEntropyLoss(
                  pos_weight=self.hparams.pos_weight
              )
          elif self.hparams.encoder_type == "logistic":
              self.loss = AsymmetricCrossEntropyLoss(
                  pos_weight=self.hparams.pos_weight, sigmoid=True
              )
          elif self.hparams.encoder_type == "table":
              self.loss = AsymmetricCrossEntropyLoss(
                  pos_weight=self.hparams.pos_weight, sigmoid=True
              )
  
      elif self.hparams.loss_type == "asymmetric_dynamic":
          raise NotImplementedError
      elif self.hparams.loss_type == "entropy":
          self.loss = nn.CrossEntropyLoss()
      else:
          raise NotImplemented
  
imports: from turtle import hideturtle
  import pytorch_lightning
  import torch
  import torch.nn.functional
  import torch.nn
  from pytorch_lightning import seed_everything
  from pathlib import Path
  from src.transformer.transformer_utils import *
  from src.transformer.metrics import CorrectedBAcc, CorrectedF1, CorrectedMCC, AUL
  import torchmetrics
label_desc: Use image node_id 2 for calling the FFN obj's underlying member method code with example usage: obj.init_loss() without return types