docstr: Compute the log-likelihood of the data.
  
  Parameters
  ----------
  x
      Data to score.
docstr_tok: ["Compute","the","log-likelihood","of","the","data",".","Parameters","--","--","--","--","--","x","Data","to","score","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """Compute the log-likelihood of the data.
  
      Parameters
      ----------
      x
          Data to score.
      """
      det = torch.linalg.det(self._inv_cov)  # Note det(A^-1)=1/det(A)
      to_means = x[:, None, :] - self.means[None, :, :]
      likelihood = (
          (
              -0.5
              * (
                  torch.einsum(
                      "bke,bke->bk",
                      (
                          torch.einsum(
                              "bkd,kde->bke", to_means, self._inv_cov
                          ),
                          to_means,
                      ),
                  )
              )
          ).exp()
          * det[None, :]
          * self._weights[None, :]
      ).sum(-1)
      return -likelihood.log()
  
imports: from torch import nn
  import torch
label_desc: Use image node_id 4 for calling the GMMModel obj's underlying member method code with example usage: obj.forward(x) and returns: unknown