Skip to content

Fix ledidi() y_bar shape for ledidi>=2.2.0 - #200

Merged
avantikalal merged 1 commit into
mainfrom
fix/ledidi-ybar-shape
Sep 16, 2026
Merged

avantikalal merged 1 commit into
mainfrom
fix/ledidi-ybar-shape

Conversation

@avantikalal

Copy link
Copy Markdown
Collaborator

Summary

  • ledidi>=2.2.0 validates that y_bar passed to Ledidi.fit_transform has a leading batch dimension of size 1; a 0-dim scalar tensor fails that check with IndexError: tuple index out of range.
  • grelu.design.ledidi()'s custom loss_func ignores the target value entirely (it only maximizes the model's own prediction), so y_bar is just a placeholder — switching it from torch.tensor(0) to torch.tensor([0]) satisfies the new validation without changing behavior.

Test plan

  • tests/test_design.py::test_ledidi passes with ledidi==2.1.0
  • tests/test_design.py::test_ledidi passes with ledidi==2.2.0 (the version installed by CI, since ledidi is unpinned in setup.cfg)

🤖 Generated with Claude Code

ledidi>=2.2.0 validates that y_bar has a leading batch dimension of
size 1, which a 0-dim scalar tensor fails. loss_func ignores the
target value entirely, so torch.tensor([0]) works as a shape-compliant
placeholder under both ledidi 2.1.0 and 2.2.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@avantikalal
avantikalal merged commit 5818f81 into main Sep 16, 2026
2 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.

1 participant