def _nllloss(self, params_out, target, sample_weight):
        """
        This is the basic way to compute the NLL loss. It can be overwritten by likelihoods for which
        PyTorch proposes a numerically better NLL loss.
        """
        out_distr = self._distr_from_params(params_out)
        loss = -out_distr.log_prob(target)
        if sample_weight is not None:
            loss = loss * sample_weight
        return loss.mean()

        This is the basic way to compute the NLL loss. It can be overwritten by likelihoods for which
        PyTorch proposes a numerically better NLL loss.
        
darts/utils/likelihood_models/torch.py