def score_samples(self, features: torch.Tensor) -> torch.Tensor:
        """Compute the negative log likelihood (NLL) scores.

        Args:
            features (torch.Tensor): Semantic features on which density modeling
                is performed with shape ``(n_samples, n_features)``.

        Returns:
            torch.Tensor: NLL scores for each sample.
        """
        features_transformed = torch.matmul(features - self.mean_vec, self.u_mat / self.sigma_mat)
        return torch.sum(features_transformed * features_transformed, dim=1) + 2 * torch.sum(torch.log(self.sigma_mat))
Compute the negative log likelihood (NLL) scores.

        Args:
            features (torch.Tensor): Semantic features on which density modeling
                is performed with shape ``(n_samples, n_features)``.

        Returns:
            torch.Tensor: NLL scores for each sample.
        
src/anomalib/models/image/dfm/torch_model.py