code: def loss_value(self, x_data, y_true, y_pred):
          
          y_pred = y_pred.view(-1, y_pred.size(2))
          y_true = y_true.view(-1).to(torch.long)
          return F.nll_loss(y_pred, y_true)
docs: Calculate a value of loss function