def compute_pred_likelihood(model, samples, test):
    Z_pred = get_inputs(test)

    preds = []
    for sample in samples:
        model.set_sample(sample)
        preds.append(model.predict(Z_pred, full_output=True)[1])

    psi_pred_mean = np.mean(preds, axis=0)

    if isinstance(model, pgmult.gp.MultinomialGP):
        pi_pred_mean = np.array([psi_to_pi(psi) for psi in psi_pred_mean])
    elif isinstance(model, pgmult.gp.LogisticNormalGP):
        from pgmult.internals.utils import ln_psi_to_pi
        pi_pred_mean = np.array([ln_psi_to_pi(psi) for psi in psi_pred_mean])
    else:
        raise NotImplementedError

    pll_gp = gammaln(test.data.sum(axis=1)+1).sum() - gammaln(test.data+1).sum()
    pll_gp += np.nansum(test.data * np.log(pi_pred_mean))
    return pll_gp
dataset/ETHPy150Open HIPS/pgmult/experiments/census_gp.py/compute_pred_likelihood/original