Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
cdaaceda
Commit
cdaaceda
authored
Feb 03, 2022
by
Gustaf Ahdritz
Browse files
Remove duplicate code
parent
3279b28d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
4 deletions
+0
-4
openfold/utils/loss.py
openfold/utils/loss.py
+0
-4
No files found.
openfold/utils/loss.py
View file @
cdaaceda
...
@@ -1570,10 +1570,6 @@ class AlphaFoldLoss(nn.Module):
...
@@ -1570,10 +1570,6 @@ class AlphaFoldLoss(nn.Module):
loss
=
loss
.
new_tensor
(
0.
,
requires_grad
=
True
)
loss
=
loss
.
new_tensor
(
0.
,
requires_grad
=
True
)
cum_loss
=
cum_loss
+
weight
*
loss
cum_loss
=
cum_loss
+
weight
*
loss
seq_len
=
torch
.
mean
(
batch
[
"seq_length"
].
float
())
crop_len
=
batch
[
"aatype"
].
shape
[
-
1
]
cum_loss
=
cum_loss
*
torch
.
sqrt
(
min
(
seq_len
,
crop_len
))
# Scale the loss by the square root of the minimum of the crop size and
# Scale the loss by the square root of the minimum of the crop size and
# the (average) sequence length. See subsection 1.9.
# the (average) sequence length. See subsection 1.9.
seq_len
=
torch
.
mean
(
batch
[
"seq_length"
].
float
())
seq_len
=
torch
.
mean
(
batch
[
"seq_length"
].
float
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment