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 edgecase with 1 input value that is not selected in subsample_data #114

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

leavauchier
Copy link
Collaborator

In the preprocessing steps when subsampling data, there was a buggy edge case when there was only one point in the batch that had to be removed.
Up to now, the point was not removed (side effect of trying to force the output to be a Tensor when only one value was kept)

@MichelDaab or @gliegard can you have a look as @CharlesGaydon is not available?
Thanks

np.array([20, 21, 22, 23, 24]),
torch.IntTensor([0, 1, 4]),
),
# Edge cases
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you be more specific one each cases ?

ex: "one value case" ..

Copy link
Collaborator

@CharlesGaydon CharlesGaydon left a comment

Choose a reason for hiding this comment

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

Minor changes in formulations (comment and changelog), but code looks good!

For reference here is a related issue explaining the cause of this edge case: #83 (comment)

],
)
def test_subsample_data(x, idx, choice):
# points w.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is a dead comment, can it be removed?

CHANGELOG.md Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you be a bit more explicit here, and specify that this fix is related to subsampling?

gliegard
gliegard previously approved these changes Mar 13, 2024
Copy link
Collaborator

@gliegard gliegard left a comment

Choose a reason for hiding this comment

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

thanks for the comments

@leavauchier leavauchier merged commit 8c01bdf into main Mar 13, 2024
1 check passed
@leavauchier leavauchier deleted the fix-subsample branch March 13, 2024 13:37
@CharlesGaydon
Copy link
Collaborator

20240313_143719.jpg

Low quality schematics for posterity 😬😅

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