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

Distribution sampling does not respect chosen number types #1566

Open
ChrisRackauckas opened this issue Jun 21, 2022 · 1 comment
Open

Distribution sampling does not respect chosen number types #1566

ChrisRackauckas opened this issue Jun 21, 2022 · 1 comment

Comments

@ChrisRackauckas
Copy link

MWE:

data_dist = Beta(2.0f0, 2.0f0)
train_data = typeof(rand(data_dist, 1, 100)) # Matrix{Float64}

This is scary 😅

@devmotion
Copy link
Member

There are multiple (open and closed) issues about this behaviour: e.g. #1071 and linked issues.

Generally, the parameters are just treated as parameters, distinct from the type of the samples. The weird thing is Normal here which behaves differently (somehow it was changed at some point). I opened a PR a while ago that fixes these inconsistencies (#1433) but it got stuck due to some ForwardDiff weirdness. I added some motivation in the PR there for why I became convinced that generally parameters and the return type of rand should be treated separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants