Skip to content

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

Merged
merged 6 commits into from
Jun 12, 2017
Merged

Update examples #2254

merged 6 commits into from
Jun 12, 2017

Conversation

junpenglao
Copy link
Member

  • use new sampling api (advi init, etc)
  • unify style

* use new sampling api (advi init, etc)
* unify style
@junpenglao junpenglao added the WIP label Jun 1, 2017
@junpenglao
Copy link
Member Author

Following the discussion in #2236

data = np.loadtxt(pm.get_data('efron-morris-75-data.tsv'), delimiter="\t",
skiprows=1, usecols=(2,3))

atBats = pm.floatX(data[:,0])
Copy link
Member

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})
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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
@junpenglao
Copy link
Member Author

junpenglao commented Jun 2, 2017

Remain to be done:

  1. Better documentation: some of the examples need some background information (ref, etc). However, it is a bit difficult for me to do as I dont know the source either.
  2. garch_example.py is still broken as the changes in Bound method. I will do a separate PR with the fix in Bound also. fixed in Allow arrays in pm.Bound #2277 by @aseyboldt

@junpenglao junpenglao removed the WIP label Jun 2, 2017
@junpenglao junpenglao changed the title [WIP] Update examples Update examples Jun 2, 2017
@junpenglao
Copy link
Member Author

Trying to fix garch_example.py and Bound and running into the same issue as #1491. Are there any clues from the last time this was fixed? @ColCarroll

@junpenglao
Copy link
Member Author

Before Merging: @springcoil could you please test it in GPU again #2033?

@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fonnesbeck is this accurate?

Copy link
Member

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.

@springcoil
Copy link
Contributor

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.

@junpenglao junpenglao mentioned this pull request Jun 9, 2017
@junpenglao junpenglao merged commit f9917a2 into pymc-devs:master Jun 12, 2017
@junpenglao junpenglao deleted the update_examples branch June 12, 2017 15:44
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

Successfully merging this pull request may close these issues.

3 participants