Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rank-2 tensors for all muon-wise variables #98

Open
GilesStrong opened this issue Apr 5, 2022 · 0 comments
Open

Rank-2 tensors for all muon-wise variables #98

GilesStrong opened this issue Apr 5, 2022 · 0 comments
Assignees
Labels
Functionality Issue adds to the functionality of the package medium priority Should be fixed soon, but doesn't disastrously impact project

Comments

@GilesStrong
Copy link
Owner

Currently code uses a mixture of rank-1 and rank-2 tensors for muon-wise variables, e.g. the momentum of a batch of muons has shape [300], but the theta_msc of their trajectories has shape [300,1]. Devs must then be careful to squeeze or unsqueeze tensors in calculations, since the rank-1 tensors can be accidentally broadcast across the rank-2 tensors, e.g. AbsX0Inferer._x0_from_dtheta can return a [300,300] tensor instead of a [300] or [300,1] tensor if the momentum is not unsqueezed.
I propose that all muon-wise variables use at least rank-2 tensors, even if the length of the last dimension is just one. This should help prevent accidental broadcasting.

@GilesStrong GilesStrong added medium priority Should be fixed soon, but doesn't disastrously impact project Functionality Issue adds to the functionality of the package labels Apr 5, 2022
@GilesStrong GilesStrong self-assigned this Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality Issue adds to the functionality of the package medium priority Should be fixed soon, but doesn't disastrously impact project
Projects
None yet
Development

No branches or pull requests

1 participant