def predict(self, features: torch.Tensor, normalize: bool = True) -> torch.Tensor:
        """Predict anomaly scores for input features.

        Computes the negative log-likelihood of each feature vector under the
        fitted GMM. Lower likelihood (higher score) indicates more anomalous
        samples.

        Args:
            features (torch.Tensor): Input feature vectors of shape ``(N, D)``.
            normalize (bool, optional): Whether to normalize scores using min-max
                statistics from training. Defaults to ``True``.

        Returns:
            torch.Tensor: Anomaly scores of shape ``(N,)``. Higher values indicate
                more anomalous samples.
        """
        density = -self.gmm.score_samples(features)
        if normalize:
            density = self._normalize(density)
        return density
Predict anomaly scores for input features.

        Computes the negative log-likelihood of each feature vector under the
        fitted GMM. Lower likelihood (higher score) indicates more anomalous
        samples.

        Args:
            features (torch.Tensor): Input feature vectors of shape ``(N, D)``.
            normalize (bool, optional): Whether to normalize scores using min-max
                statistics from training. Defaults to ``True``.

        Returns:
            torch.Tensor: Anomaly scores of shape ``(N,)``. Higher values indicate
                more anomalous samples.
        
src/anomalib/models/video/ai_vad/density.py