-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I believe there is a semantic issue in the implementation of smooth_lddt_loss related to batch averaging.
Below is the original code (unchanged):
# Compute epsilon values
eps = (
(
(
F.sigmoid(0.5 - dist_diff)
+ F.sigmoid(1.0 - dist_diff)
+ F.sigmoid(2.0 - dist_diff)
+ F.sigmoid(4.0 - dist_diff)
)
/ 4.0
)
.view(B, N, N)
.mean(dim=0)
)
# Calculate masked averaging
num = (eps * mask).sum(dim=(-1, -2))
den = mask.sum(dim=(-1, -2)).clamp(min=1)
lddt = num / dendist_diffhas shape [B, N, N]maskalso has shape [B, N, N] and is per-sample, since it depends oncoords_mask- However,
epsis averaged over the batch dimension using.mean(dim=0), resulting in shape [N, N]
This means each sample uses batch-averaged pairwise scores, even though the mask is sample-specific.
When coords_mask differs across samples or B > 1, this no longer matches the intended lDDT / smooth-lDDT semantics.
Thanks a lot for the great work on this project, and I hope this report is helpful.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested