Skip to content

Conversation

fonnesbeck
Copy link
Member

@fonnesbeck fonnesbeck commented Nov 18, 2016

Making sure all the notebooks run on current master before release, and cleaning up (e.g. deleting stray cells and correcting typos).

Removed discrete_find_MAP.ipynb for now; we can replace it after 3.0 release if we can make it work.

  • GLM-logistic does not sample properly
  • GLM-model-selection takes over an hour to run. Perhaps not worth bundling with the examples?
  • survival_analysis.ipynb and pmf_pymc.ipynb both unacceptably slow as written. Need to revised or drop.
  • NUTS_scaling_using_ADVI hangs on the NUTS initialised using ADVI mean section and does not produce a trace for NUTS initialise MAP at test_point section
  • LKJ notebook mysteriously stops mixing.

Replaces #1465

This was referenced Nov 18, 2016
@ColCarroll
Copy link
Member

Easy check on a lot of these is whether they use the tqdm-style
progressbars in the ADVI tasks

On Fri, Nov 18, 2016 at 5:14 PM Peadar Coyle notifications@github.com
wrote:

@springcoil approved this pull request.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1535 (review),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACMHEIGmWif1xoyhqWC_ZkaNhGe9StiYks5q_iM5gaJpZM4K29si
.

@springcoil
Copy link
Contributor

======================================================================
ERROR: test_normal (pymc3.tests.test_examples.TestHierarchical)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tests/test_examples.py", line 242, in test_normal
    start = pm.find_MAP()
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tuning/starting.py", line 77, in find_MAP
    dlogp = bij.mapf(model.fastdlogp(vars))
  File "/home/travis/build/pymc-devs/pymc3/pymc3/model.py", line 159, in fastdlogp
    return self.model.fastfn(gradient(self.logpt, vars))
  File "/home/travis/build/pymc-devs/pymc3/pymc3/memoize.py", line 15, in memoizer
    cache[key] = obj(*args, **kwargs)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 60, in gradient
    return tt.concatenate([gradient1(f, v) for v in vars], axis=0)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 60, in <listcomp>
    return tt.concatenate([gradient1(f, v) for v in vars], axis=0)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 48, in gradient1
    return tt.flatten(tt.grad(f, v, disconnected_inputs='warn'))
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 553, in grad
    grad_dict, wrt, cost_name)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1317, in _populate_grad_dict
    rval = [access_grad_cache(elem) for elem in wrt]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1317, in <listcomp>
    rval = [access_grad_cache(elem) for elem in wrt]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1272, in access_grad_cache
    term = access_term_cache(node)[idx]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1106, in access_term_cache
    new_output_grads)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gof/op.py", line 700, in L_op
    return self.grad(inputs, output_grads)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/elemwise.py", line 717, in grad
    sr = sr.dimshuffle(shuffle)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/var.py", line 363, in dimshuffle
    pattern)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/elemwise.py", line 175, in __init__
    (input_broadcastable, new_order))
ValueError: ('You cannot drop a non-broadcastable dimension.', ((True, False), ('x', 'x', 0)))
-------------------- >> begin captured logging << --------------------
pymc3: DEBUG: Applied interval-transform to sg and added transformed sg_interval_ to model.
pymc3: DEBUG: Applied interval-transform to s and added transformed s_interval_ to model.
--------------------- >> end captured logging << ---------------------
======================================================================
ERROR: test_sqlite (pymc3.tests.test_examples.TestHierarchical)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tests/test_examples.py", line 248, in test_sqlite
    start = pm.find_MAP()
  File "/home/travis/build/pymc-devs/pymc3/pymc3/tuning/starting.py", line 77, in find_MAP
    dlogp = bij.mapf(model.fastdlogp(vars))
  File "/home/travis/build/pymc-devs/pymc3/pymc3/model.py", line 159, in fastdlogp
    return self.model.fastfn(gradient(self.logpt, vars))
  File "/home/travis/build/pymc-devs/pymc3/pymc3/memoize.py", line 15, in memoizer
    cache[key] = obj(*args, **kwargs)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 60, in gradient
    return tt.concatenate([gradient1(f, v) for v in vars], axis=0)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 60, in <listcomp>
    return tt.concatenate([gradient1(f, v) for v in vars], axis=0)
  File "/home/travis/build/pymc-devs/pymc3/pymc3/theanof.py", line 48, in gradient1
    return tt.flatten(tt.grad(f, v, disconnected_inputs='warn'))
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 553, in grad
    grad_dict, wrt, cost_name)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1317, in _populate_grad_dict
    rval = [access_grad_cache(elem) for elem in wrt]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1317, in <listcomp>
    rval = [access_grad_cache(elem) for elem in wrt]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1272, in access_grad_cache
    term = access_term_cache(node)[idx]
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gradient.py", line 1106, in access_term_cache
    new_output_grads)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/gof/op.py", line 700, in L_op
    return self.grad(inputs, output_grads)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/elemwise.py", line 717, in grad
    sr = sr.dimshuffle(shuffle)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/var.py", line 363, in dimshuffle
    pattern)
  File "/home/travis/minconda3/envs/testenv/lib/python3.5/site-packages/theano/tensor/elemwise.py", line 175, in __init__
    (input_broadcastable, new_order))
ValueError: ('You cannot drop a non-broadcastable dimension.', ((True, False), ('x', 'x', 0)))

Are these related to the other Theano errors we ran into before?

@twiecki twiecki added the WIP label Nov 19, 2016
@fonnesbeck
Copy link
Member Author

Yeah I only changed ipynb files so it's hard to see how any changes could have resulted in these errors.

@ColCarroll
Copy link
Member

Can confirm that the same tests fail on master in the docker image.

@springcoil
Copy link
Contributor

So it's unrelated to this converge, we've got some tests coming back. It looks to me like a theano error - what do you think @ColCarroll

@ColCarroll
Copy link
Member

Yeah -- a rebase off master should fix the failure.

@springcoil
Copy link
Contributor

The model selection stuff is useful, however it's included in the documentation right?

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

Removed discrete_find_MAP.ipynb

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

WIP: Notebooks updated rugby analytics
@springcoil
Copy link
Contributor

I rebased and reran the Rugby Analytics notebook.

@springcoil
Copy link
Contributor

Ok the test errors are resolved. @fonnesbeck are you ready to merge yet?

@fonnesbeck
Copy link
Member Author

fonnesbeck commented Nov 20, 2016

Not yet, no. Will remove the WIP tag when done.

I'm tallying problems with the current set of notebooks, with respect to how they run locally from the current master. Several take hours to run, which probably means we should exclude them from the examples unless they can be revised.

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

Removed discrete_find_MAP.ipynb

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

WIP: Notebooks updated rugby analytics
@fonnesbeck
Copy link
Member Author

The LKJ notebook appears broken. See the divergent traceplot in the current commit.

@fonnesbeck
Copy link
Member Author

Other than the list at the top of the page, the notebooks look good in this PR. I'm happy to drop these notebooks for the release, unless an easy fix can be found (everything does not have to be a bundled example, after all). Please have a look.

@springcoil
Copy link
Contributor

That's all fine by me. Happy that these notebooks are dropped for the
release. We can add them back in later.

On 23 Nov 2016 8:39 PM, "Chris Fonnesbeck" notifications@github.com wrote:

Other than the list at the top of the page, the notebooks look good in
this PR. I'm happy to drop these notebooks for the release, unless an easy
fix can be found (everything does not have to be a bundled example, after
all). Please have a look.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1535 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA8DiH2VShNSQSW_6MWQhkR8IZvw6RZEks5rBKR7gaJpZM4K29si
.

@twiecki
Copy link
Member

twiecki commented Nov 23, 2016

LKJ used Metropolis initially, maybe we should switch it back.

@twiecki
Copy link
Member

twiecki commented Nov 23, 2016

pmf-pymc is slow but it's a big model and a great, comprehensive example. we shouldn't drop it.

@springcoil
Copy link
Contributor

Actually that's a good point, since Probabilistic Matrix Factorization is a good use case for Bayesian Stats - maybe just adding a warning 'this will take a while'.

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

Removed discrete_find_MAP.ipynb

Cleanup of several notebooks

Additional cleanup of notebooks

Cleanup of additional notebooks

WIP: Notebooks updated rugby analytics
@twiecki
Copy link
Member

twiecki commented Nov 25, 2016

Rebased.

@twiecki
Copy link
Member

twiecki commented Nov 25, 2016

OK, I fixed the issues in the NBs and removed 2 (logistic and nuts scaling). I think we should keep pmf and survival in their current form -- they are slow but complex models so a longer running time is acceptable. Long term we should work on improving the inference to make those faster.

@twiecki twiecki removed the WIP label Nov 25, 2016
@twiecki
Copy link
Member

twiecki commented Nov 25, 2016

I also converted the getting started NB to use auto-assigned step methods and NUTS auto-initialization. Makes the code and text much simpler.

@fonnesbeck
Copy link
Member Author

I'm happy with this. Thanks for lending a hand.

@fonnesbeck
Copy link
Member Author

In the future, we should probably avoid growing the bundled notebooks set any larger. Not everything has to be included in the repository. Might be worth setting up a site (repo/wiki?) to house a wider array of examples. There is a fair amount of overlap among the current set of notebooks, and several are not well-annotated, so new notebooks should probably displace an existing one, rather than expanding the set.

@twiecki twiecki merged commit 8a59d87 into master Nov 28, 2016
@junpenglao junpenglao deleted the tidy_notebooks branch June 26, 2017 12:26
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.

4 participants