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

Fix to PeriodicPadding to match pytorch circular padding #2435

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

jvwilliams23
Copy link
Contributor

@jvwilliams23 jvwilliams23 commented Apr 15, 2024

Hi,

I found that the output of lm.PeriodicPadding2D did not match the output of torch.nn.functional.pad(*, mode="circular"). See below for figure comparing the original implementation - clearly the middle image is doing the equivalent of mode = "replicate" padding (not periodic/circular). I modified the existing CI test to compare against the torch function (it previously compared against padding done using np.concatenate).

lbann_periodicpadding_error

I also made some modifications to the docstring.

Cheers,
Josh

@jvwilliams23 jvwilliams23 marked this pull request as ready for review April 16, 2024 08:02
Copy link
Contributor

@fiedorowicz1 fiedorowicz1 left a comment

Choose a reason for hiding this comment

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

Great catch, thanks for the PR! There are a couple of other things I caught that I will add to this PR.

@fiedorowicz1 fiedorowicz1 merged commit 052c602 into LLNL:develop Apr 18, 2024
1 check 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.

3 participants