def get_score(self):
        """note that NLL score need the updated model and data loader each time, use reset() before get_score()"""
        if not self.if_use:
            return 0
        assert self.model and self.data_loader, 'Need to reset() before get_score()!'

        if self.leak_dis is not None:  # For LeakGAN
            return self.cal_nll_with_leak_dis(self.model, self.data_loader, self.leak_dis, self.gpu)
        elif self.label_i is not None:  # For category text generation
            return self.cal_nll_with_label(self.model, self.data_loader, self.label_i,
                                           self.criterion, self.gpu)
        else:
            return self.cal_nll(self.model, self.data_loader, self.criterion, self.gpu)
note that NLL score need the updated model and data loader each time, use reset() before get_score()
metrics/nll.py