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

at least one instance of hyperparameters does not work #6

Open
joel-becker opened this issue Mar 7, 2023 · 1 comment
Open

at least one instance of hyperparameters does not work #6

joel-becker opened this issue Mar 7, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@joel-becker
Copy link

this would work in squiggle

a = normal(0, 1)
b = normal(a, 1)

but doesn't work in squigglepy

>>> c = sq.norm(mean=sq.norm(mean=0,sd=1), sd=1)
>>> c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/joel/Library/Python/3.9/lib/python/site-packages/squigglepy/distributions.py", line 40, in __repr__
    return str(self)
  File "/Users/joel/Library/Python/3.9/lib/python/site-packages/squigglepy/distributions.py", line 588, in __str__
    round(self.mean, 2),
TypeError: type NormalDistribution doesn't define __round__ method
>>> c.mean
<Distribution> norm(mean=0, sd=1)

i guess because sampling is determined by the user, after computing everything else, in order to keep squigglepy very fast. i definitely appreciate the speed, but there have been a couple of times when "something like the above example, implemented fast enough for a web app" would be dreamy.

@peterhurford
Copy link
Collaborator

Hmm I hadn't thought about this but I can make it happen!

@peterhurford peterhurford added the enhancement New feature or request label Mar 7, 2023
@peterhurford peterhurford added this to the v0.27 milestone Jun 10, 2023
@peterhurford peterhurford modified the milestones: v0.27, v0.28 Oct 22, 2023
@peterhurford peterhurford modified the milestones: v0.28, v0.29 Aug 20, 2024
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

2 participants