Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the model we use in test and benchmark #378

Closed
junpenglao opened this issue Oct 11, 2022 · 0 comments · Fixed by #388
Closed

Improve the model we use in test and benchmark #378

junpenglao opened this issue Oct 11, 2022 · 0 comments · Fixed by #388
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@junpenglao
Copy link
Member

Currently, in test and benchmark we use a simple linear regression, with the logprob function as:

def regression_logprob(scale, coefs, preds, x):
    """Linear regression"""
    scale_prior = stats.expon.logpdf(scale, 1, 1)
    coefs_prior = stats.norm.logpdf(coefs, 0, 5)
    y = jnp.dot(x, coefs)
    logpdf = stats.norm.logpdf(preds, y, scale)
    return sum(x.sum() for x in [scale_prior, coefs_prior, logpdf])

However, the free parameter scale is positive only, which can create problem for HMC. We should rewrite the logprob func so that the free parameters are in $R$ (e.g., what we are doing in https://blackjax-devs.github.io/blackjax/examples/change_of_variable_hmc.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant