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 dimensionality issue when binary classification outputs 1D instead of 2D tensor #609

Conversation

XianzheMa
Copy link
Collaborator

@XianzheMa XianzheMa commented Sep 1, 2024

For binary classification (e.g. DLRM), there are two problems:

  1. The model output no longer has shape (batch_size, num_classes). The size is not even (batch_size, 1) as the second dimension, 1, is squeezed.
  2. The model output is not passed through a softmax layer but a sigmoid layer.

This PR adapts the existing downsamplers to the binary classfication.

@XianzheMa XianzheMa changed the title fix the dimension problem when it is binary classification Fix the dimension problem when it is binary classification Sep 1, 2024
Copy link

codecov bot commented Sep 1, 2024

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.62%. Comparing base (4e1550d) to head (eabe7de).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...mplers/remote_uncertainty_downsampling_strategy.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
+ Coverage   85.60%   85.62%   +0.02%     
==========================================
  Files         258      258              
  Lines       11311    11327      +16     
==========================================
+ Hits         9683     9699      +16     
  Misses       1628     1628              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XianzheMa XianzheMa marked this pull request as ready for review September 7, 2024 03:05
Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

Thank you! This mostly looks good, I had a couple of clarification comments and suggestions.

@MaxiBoether MaxiBoether changed the title Fix the dimension problem when it is binary classification Fix dimensionality issue when binary classification outputs 1D instead of 2D tensor Sep 11, 2024
Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

Thank you, Xianzhe! This LGTM!

@XianzheMa XianzheMa merged commit 4b424d6 into eth-easl:main Sep 11, 2024
24 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.

2 participants