optimize_tensor

Function optimize_tensor 

Source
pub fn optimize_tensor<B: Backend>(
    log_likelihood: Tensor<B, 2>,
    log_counts: Tensor<B, 1>,
    alpha0: Tensor<B, 1>,
    options: &OptimizerOpts,
) -> Result<(Tensor<B, 1>, Tensor<B, 2>), Box<dyn Error>>
Expand description

Run on Tensor inputs

Preferred function when efficiency is required but you don’t want to call optimizer directly.

burn Backend must be given as the generic <B: Backend>.

§Inputs

  • log_likelihood: column-major n_cols x n_rows log-likelihood matrix.
  • log_counts: n_rows vector of natural logarithms of the weights for log_likelihood rows.
  • alpha0: n_cols vector of prior counts for the Dirichlet model.
  • options: OptimizerOpts.

§Outputs:

  • thetas: n_cols vector of inferred mixing proportions.
  • gamma_Z: flattened n_cols x n_rows column-major matrix containing inferred probabilities that the row i was generated from cluster j.