pub fn optimize_flat(
log_likelihood: &[f32],
log_counts: &[f32],
prior: &[f32],
opts: Option<OptimizerOpts>,
) -> Result<(Vec<f32>, Vec<f32>), Box<dyn Error>>Expand description
Run on flattened f32 vector inputs
Wrapper around run_optimizer & optimize_tensor(optimize_tensor<B: Backend>) to run inference.
Preferred for running on any backend supported by BurnBackend and given via OptimizerOpts.
§Inputs
log_likelihood: column-majorn_cols x n_rowslog-likelihood matrix.log_counts:n_rowsvector of natural logarithms of the weights forlog_likelihoodrows.prior:n_colsvector of prior counts for the Dirichlet model.opts: OptimizerOpts.
§Outputs:
thetas:n_colsvector of inferred mixing proportions.gamma_Z: flattenedn_cols x n_rowscolumn-major matrix containing inferred probabilities that the rowiwas generated from clusterj.