-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Update examples #2254
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
Update examples #2254
Conversation
junpenglao
commented
Jun 1, 2017
- use new sampling api (advi init, etc)
- unify style
* use new sampling api (advi init, etc) * unify style
Following the discussion in #2236 |
pymc3/examples/baseball.py
Outdated
data = np.loadtxt(pm.get_data('efron-morris-75-data.tsv'), delimiter="\t", | ||
skiprows=1, usecols=(2,3)) | ||
|
||
atBats = pm.floatX(data[:,0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid camelCase
with model: | ||
# initialize NUTS() with ADVI under the hood | ||
trace = pm.sample( n ) | ||
trace = pm.sample(n, nuts_kwargs={'target_accept':.99}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, does it require this to converge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine without, but there is a divergent warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem; just surprised.
* add example into pm.Bound warning, also improve pm.Bound docstring
Remain to be done:
|
Trying to fix |
Before Merging: @springcoil could you please test it in GPU again #2033? |
pymc3/distributions/distribution.py
Outdated
@@ -476,8 +476,14 @@ class Bound(object): | |||
|
|||
Example | |||
------- | |||
boundedNormal = pymc3.Bound(pymc3.Normal, lower=0.0) | |||
par = boundedNormal(mu=0.0, sd=1.0, testval=1.0) | |||
# In general Bounded distribution need to be defined befor model context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fonnesbeck is this accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've defined them inside a context before. I don't think it matters (it shouldn't).
Also, before has an "e" at the end.
depends on #2277 by @aseyboldt
I'll have a look this weekend maybe (swamped with work before then). Looks good work though I'll check it on a GPU though. |