Skip to content

Discrepancy between paper's loss description and code: MSE on unnormalized embeddings #6

@gdewael

Description

@gdewael

Hi!

The preprint describes the mapping loss as MSE on normalized embeddings, which would be equivalent to a cosine loss (2 - 2·cos(y_true, y_pred)). However, in the released code, the normalizations appear to be commented out:

# z_s_n = F.normalize(z_s, dim=-1)
# z_m_n = F.normalize(z_m, dim=-1)
# mu_n = F.normalize(mu_s, dim=-1)
z_s_n = z_s
z_m_n = z_m
mu_n = mu_s

Similarly, the molecule embedding projection + normalization is commented out at line 135

# z_m = F.normalize(self.chem_proj(z_m), dim=-1)

This means the MSE loss operates on unnormalized embeddings, which is not equivalent to cosine loss.

L_map = F.mse_loss(mu_n, z_m_n, reduction='mean') # * mu_n.size(1)

Could you clarify:

  1. If I'm overlooking something?
  2. If the released checkpoints correspond to training with normalized or unnormalized MSE?
  3. If the paper description reflects the intended final configuration, or were the normalizations intentionally disabled?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions