Skip to content

Stabilize PyTorch CRAFT shape test - #187

Merged
Agustin-Picard merged 1 commit into
masterfrom
fix/craft-torch-test
Sep 21, 2026
Merged

Agustin-Picard merged 1 commit into
masterfrom
fix/craft-torch-test

Conversation

@Agustin-Picard

Copy link
Copy Markdown
Member

Stabilize the PyTorch CRAFT shape test that could fail intermittently during NMF
importance estimation.

Root Cause

The test generated random data and model weights. A random convolution followed by
ReLU could produce all-zero activations, causing NMF to learn an all-zero concept
bank. Newer scikit-learn validation then rejected that bank during transform().

Changes

  • Generate deterministic inputs and labels.
  • Initialize positive, distinct convolution weights and bias.
  • Run the test model in evaluation mode to disable dropout.
  • Assert that activations and the fitted concept bank are non-degenerate.

@Agustin-Picard Agustin-Picard self-assigned this Sep 21, 2026
@Agustin-Picard Agustin-Picard added the bug Something isn't working label Sep 21, 2026

@AntoninPoche AntoninPoche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Agustin-Picard
Agustin-Picard merged commit 5f78462 into master Sep 21, 2026
25 checks passed
@Agustin-Picard
Agustin-Picard deleted the fix/craft-torch-test branch September 21, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants