Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dependent density notebook update#706

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
fonnesbeck wants to merge2 commits intopymc-devs:main
base:main
Choose a base branch
Loading
fromfonnesbeck:dependent_density_update

Conversation

@fonnesbeck
Copy link
Member

@fonnesbeckfonnesbeck commentedSep 21, 2024
edited by github-actionsbot
Loading

Updated code to v5, sampling to NUTS


📚 Documentation preview 📚:https://pymc-examples--706.org.readthedocs.build/en/706/

@review-notebook-app
Copy link

Check out this pull request on ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered byReviewNB

@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:17Z
----------------------------------------------------------------

Line #9.        beta = pm.Normal("beta", 0.0, 5.0, dims=("one", "K"))

I quite dislike thisone dummy dimension. We could eliminate it and use broadcast multiplication instead of a dot product. The dot seems inappropriate -- the shapes appear to be(n_obs, 1), (1, K),which is just an outer product between two vectors. So make everything 1d and usept.outer.


@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:18Z
----------------------------------------------------------------

Line #10.        x = pm.Data("x", std_range)

Add dims?


@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:19Z
----------------------------------------------------------------

Remove references to PyMC3 here


@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:19Z
----------------------------------------------------------------

Line #4.        mu = pm.Deterministic("mu", gamma + x @ delta)

Same comment as above,delta should havedims=("K",),and writegamma + pt.outer(x, delta)

Also mu is missing dims


@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:20Z
----------------------------------------------------------------

Line #4.        obs = pm.NormalMixture("obs", w, mu, tau=tau, observed=y)

dims on obs (and y)


@review-notebook-app
Copy link

review-notebook-appbot commentedSep 28, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-28T05:36:21Z
----------------------------------------------------------------

Looks like every draw diverged. Going to need to tune this to make it work with NUTS.


fonnesbeck reacted with confused emoji

@jessegrabowski
Copy link
Member

Made some comments -- there are a few references to PyMC3 that need to be removed, plus a lot of nitpicks. The biggest problem is in the sampling. Every draw is divergent :( Maybe try nutpie?

@fonnesbeck
Copy link
MemberAuthor

Oof, totally missed the divergences. Odd that the resulting fit was so good.

I tried nutpie and numpyro, but it does not seem to like the stick-breaking piece (even after fixing the outer products). Works okay with Metropolis, so for expediency I'm sticking with this.

@review-notebook-app
Copy link

review-notebook-appbot commentedSep 30, 2024
edited
Loading

View / edit / reply tothis conversation on ReviewNB

jessegrabowski commented on 2024-09-30T14:47:46Z
----------------------------------------------------------------

typo: September 2024


@jessegrabowski
Copy link
Member

Random question: we havepm.StickBreakingWeights, is that something that could be used for this model instead of the hand-rolled function?

@fonnesbeck
Copy link
MemberAuthor

We would have to reframe the problem somewhat, asStickBreakingWeights models them as a function of a concentration parameter, rather than the linear model used here.

@jessegrabowski
Copy link
Member

Ok. That doesn't sound worth it? I was just curious.

@zaxtaxzaxtax self-requested a reviewJanuary 19, 2025 18:46
Copy link
Contributor

@zaxtaxzaxtax left a comment

Choose a reason for hiding this comment

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

Aside from a small typo this looks LGTM

$$w_i\ |\ x = v_i\ |\ x \cdot \prod_{j = 1}^{i - 1} (1 - v_j\ |\ x).$$

For the LIDAR data set, we use independent normal priors $\alpha_i \sim N(0, 5^2)$ and $\beta_i \sim N(0, 5^2)$. We now express this this model for the conditional mixture weights using`PyMC3`.
For the LIDAR data set, we use independent normal priors $\alpha_i \sim N(0, 5^2)$ and $\beta_i \sim N(0, 5^2)$. We now express this this model for the conditional mixture weights using`PyMC`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo.

@fonnesbeck
Copy link
MemberAuthor

@zaxtax Thanks! Looks like it needs to be re-approved after the fix.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zaxtaxzaxtaxzaxtax approved these changes

@OriolAbrilOriolAbrilAwaiting requested review from OriolAbril

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@fonnesbeck@jessegrabowski@zaxtax

[8]ページ先頭

©2009-2025 Movatter.jp