amatorch.inference

Compute probability of observed points given a set of distributions (and obtain the distribution parameters given a labeled dataset).

Functions

class_statistics(points, labels)

Compute the mean and covariance of each class.

gaussian_log_likelihoods(points, means, ...)

Compute the log-likelihood of each class assuming conditional Gaussian distributions.

amatorch.inference.class_statistics(points, labels)

Compute the mean and covariance of each class.

Parameters:
  • points (torch.Tensor) – Data points with shape (n_points, n_dim).

  • labels (torch.Tensor) – Class labels of each point with shape (n_points).

Returns:

A dictionary containing: - means: torch.Tensor of shape (n_classes, n_dim), the mean of each class. - covariances: torch.Tensor of shape (n_classes, n_dim, n_dim), the

covariance matrix of each class.

Return type:

dict

amatorch.inference.gaussian_log_likelihoods(points, means, covariances)

Compute the log-likelihood of each class assuming conditional Gaussian distributions.

Parameters:
  • points (torch.Tensor) – Points at which to evaluate the log-likelihoods with shape (n_points, n_dim).

  • means (torch.Tensor) – Mean of each class with shape (n_classes, n_dim).

  • covariances (torch.Tensor) – Covariance matrix of each class with shape (n_classes, n_dim, n_dim).

Returns:

log_likelihoods – Log-likelihoods for each class with shape (n_points, n_classes).

Return type:

torch.Tensor