Skip to content

[breaking] force logit output of focal loss to conform to (N, 2) shape for binary classification#1313

Draft
thvasilo wants to merge 1 commit into
awslabs:mainfrom
thvasilo:focal-out-shape
Draft

[breaking] force logit output of focal loss to conform to (N, 2) shape for binary classification#1313
thvasilo wants to merge 1 commit into
awslabs:mainfrom
thvasilo:focal-out-shape

Conversation

@thvasilo

@thvasilo thvasilo commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

Issue #, if available:

#1242

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@thvasilo thvasilo added this to the 0.5.0 release milestone Aug 4, 2025
@thvasilo thvasilo self-assigned this Aug 4, 2025
@thvasilo thvasilo added break back compatibility ready able to trigger the CI labels Aug 4, 2025
@thvasilo thvasilo force-pushed the focal-out-shape branch 2 times, most recently from 81b4a4d to ffd6bcc Compare August 4, 2025 23:31

@classicsong classicsong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The key problem of setting decoder_output_dim=2 is that we change the implementation of the decoder layer. Specifically, it's parameter size will be 2X larger and the parameters are impacted by the [:, 1].

Comment thread python/graphstorm/model/loss_func.py
@classicsong

Copy link
Copy Markdown
Contributor

The key problem of setting decoder_output_dim=2 is that we change the implementation of the decoder layer. Specifically, it's parameter size will be 2X larger and the parameters are impacted by the [:, 1].

Theoretically, the effective parameters of both decoder implementations are identical. The difference is, with the new implementation the output [:, 0] is meaningless. @thvasilo Can you set [:, 0] to all zeros when returning it for inference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

break back compatibility ready able to trigger the CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants