Commit 1df55b4e authored by Geoffrey Yu's avatar Geoffrey Yu
Browse files

fixed lddt_loss nan error

parent edb4858e
...@@ -541,9 +541,8 @@ def lddt_loss( ...@@ -541,9 +541,8 @@ def lddt_loss(
cutoff=cutoff, cutoff=cutoff,
eps=eps eps=eps
) )
score = torch.nan_to_num(score,nan=torch.nanmean(score))
score = score.detach() score = score.detach()
bin_index = torch.floor(score * no_bins).long() bin_index = torch.floor(score * no_bins).long()
bin_index = torch.clamp(bin_index, max=(no_bins - 1)) bin_index = torch.clamp(bin_index, max=(no_bins - 1))
lddt_ca_one_hot = torch.nn.functional.one_hot( lddt_ca_one_hot = torch.nn.functional.one_hot(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment