Skip to content

Fold the receptive field into the Xavier fans - #77

Merged
jessegrabowski merged 3 commits into
pymc-devs:mainfrom
jessegrabowski:xavier-fans-and-housekeeping
Aug 10, 2026
Merged

Fold the receptive field into the Xavier fans#77
jessegrabowski merged 3 commits into
pymc-devs:mainfrom
jessegrabowski:xavier-fans-and-housekeeping

Conversation

@jessegrabowski

Copy link
Copy Markdown
Member

sqrt(2 / sum(shape)) is the right fan computation only for a matrix, so a conv kernel came out about 2.7x too wide, and a 1-D parameter got a number with no meaning behind it — that now raises. Nothing in the tree has a 4-D weight yet, so this lands ahead of the conv work rather than fixing anything shipping, and every existing 2-D parameter draws bit-identically since the fan sum is the shape sum there. Fan-in is the leading dimension, matching Linear's (n_in, n_out) rather than torch's transpose of it — invisible to Xavier, load-bearing for anything that scales by fan-in alone.

Two unrelated riders: Dropout builds its generators with pytensor's shared_rng, and the tracked mnist notebook's matplotlib and tqdm are declared.

Passing a Generator to `shared` already returns a RandomGeneratorSharedVariable, so this changes which constructor is written rather than what is built.
Summing the shape is the fan computation only for a matrix, so a 3x3 kernel came out around 2.7x too wide; the leading dimension is the fan-in here, matching this library's (n_in, n_out) layout rather than torch's transpose of it.
examples/mnist_feed_forward.ipynb imports both and neither was listed anywhere, so the tracked example could not be run from a declared install.
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (f60deb7) to head (acdc8cc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   95.42%   95.43%   +0.01%     
==========================================
  Files          45       45              
  Lines        1792     1798       +6     
==========================================
+ Hits         1710     1716       +6     
  Misses         82       82              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@jessegrabowski
jessegrabowski merged commit 37b643c into pymc-devs:main Aug 10, 2026
7 checks passed
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.

2 participants