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

Add warning if a Minibatched variable is used without total_size#7742

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

Merged
zaxtax merged 4 commits intopymc-devs:mainfromzaxtax:include_minibatch_warning
Apr 1, 2025

Conversation

@zaxtax
Copy link
Contributor

@zaxtaxzaxtax commentedMar 30, 2025
edited
Loading

Description

This should help catch a well-known Minibatch footgun where a user forgets to include thetotal_size argument

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

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

…ttenThis should help catch a well-known Minibatch footgun
@zaxtaxzaxtax requested a review fromricardoV94March 30, 2025 14:20
@codecov
Copy link

codecovbot commentedMar 30, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.82%. Comparing base(fb4b201) to head(e10511a).
Report is 41 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@##             main    #7742   +/-   ##=======================================  Coverage   92.82%   92.82%           =======================================  Files         107      107             Lines       18324    18326    +2     =======================================+ Hits        17010    17012    +2  Misses       1314     1314
Files with missing linesCoverage Δ
pymc/model/core.py92.99% <100.00%> (+0.01%)⬆️

... and1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jessegrabowskijessegrabowski left a comment

Choose a reason for hiding this comment

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

LGTM. My only suggestion is that we have some way for a user who knows he doesn't want to settotal_size to somehow avoid the warning. I can't think of a case where anyone would want to do this, but something liketotal_size=False to silence the warning might be nice?

Might also be too convoluted.

@zaxtax
Copy link
ContributorAuthor

zaxtax commentedApr 1, 2025 via email
edited
Loading

I don't think you ever want to not set total_size if you are doingminibatching. If you are doing something fancy you probably are justsetting it to something other than len(data)
On Tue, 1 Apr 2025, 10:10 Jesse Grabowski, ***@***.***> wrote: ***@***.**** approved this pull request. LGTM. My only suggestion is that we have some way for a user who knows he doesn't want to set total_size to somehow avoid the warning. I can't think of a case where anyone would want to do this, but something like total_size=False to silence the warning might be nice? Might also be too convoluted. — Reply to this email directly, view it on GitHub <#7742 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAACCUIZBJRM5CAGC5PTEQL2XJCWHAVCNFSM6AAAAAB2CSI7Q6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDOMZRHA2TGMBXGI> . You are receiving this because you authored the thread.Message ID: ***@***.***>

@zaxtaxzaxtax merged commit4185b7b intopymc-devs:mainApr 1, 2025
25 checks passed
self.add_named_variable(rv_var,dims)
self.set_initval(rv_var,initval)
else:
if (
Copy link
Member

Choose a reason for hiding this comment

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

this should have checked if minibatch is anywhere in the ancestors of value not just immediately

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Do we need to do that? This check is only for observed random variables. I thought for those we don't allow the value to depend on another node

@zaxtaxzaxtax mentioned this pull requestApr 3, 2025
9 tasks
vandalt pushed a commit to vandalt/pymc that referenced this pull requestMay 14, 2025
…c-devs#7742)Add warning if a Minibatched variable is used but total_size is forgottenThis should help catch a well-known Minibatch footgun
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ricardoV94ricardoV94ricardoV94 left review comments

@jessegrabowskijessegrabowskijessegrabowski approved these changes

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

@zaxtax@ricardoV94@jessegrabowski

[8]ページ先頭

©2009-2025 Movatter.jp