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

Allow rand to sample from non-identical Sampleables over time #71

Open
tpgillam opened this issue Aug 5, 2022 · 0 comments
Open

Allow rand to sample from non-identical Sampleables over time #71

tpgillam opened this issue Aug 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tpgillam
Copy link
Owner

tpgillam commented Aug 5, 2022

See original comment below. On discussion, we think that this is a good thing to do, even though it is breaking.

Original comment:
 
@willtebbutt I'm actually wondering if it would be good to make a breaking change here, whilst working on this section.

Currently, this version of rand takes:

  • A node x, which is used only for alignment
  • (maybe) a constant S, determining the sampleable
  • (maybe) some dimensions d (either tuple or int varargs), which make the output value type be an array

I think it might be more future proof to unify x and S.

Pros: it means that in the future, one can e.g. have a node that ticks with distributions, so that the random value drawn at each knot can be drawn from that distribution.

Cons: It is breaking (although better now than later), and it's slightly more awkward to generate "trivial" random numbers.

e.g. old:

x = pulse(Hour(1))
y = rand(x)

new:

S = align(Float64, pulse(Hour(1)))  # i.e. a node that ticks with `Float64` every time that we wish to sample
y = rand(S)

Any thoughts?

Originally posted by @tpgillam in #67 (comment)

@tpgillam tpgillam added the enhancement New feature or request label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant