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
dgl
Commits
68c0cfbb
"git@developer.sourcefind.cn:OpenDAS/deepspeed.git" did not exist on "7435b2f10af773b0204e77c3549b2b7df9a7a65b"
Unverified
Commit
68c0cfbb
authored
Aug 16, 2021
by
Peiqi Yin
Committed by
GitHub
Aug 16, 2021
Browse files
[Model] Fix diffpool loss (#3233)
parent
31772b14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
examples/pytorch/diffpool/model/encoder.py
examples/pytorch/diffpool/model/encoder.py
+2
-0
No files found.
examples/pytorch/diffpool/model/encoder.py
View file @
68c0cfbb
...
...
@@ -214,6 +214,8 @@ class DiffPool(nn.Module):
#softmax + CE
criterion
=
nn
.
CrossEntropyLoss
()
loss
=
criterion
(
pred
,
label
)
for
key
,
value
in
self
.
first_diffpool_layer
.
loss_log
.
items
():
loss
+=
value
for
diffpool_layer
in
self
.
diffpool_layers
:
for
key
,
value
in
diffpool_layer
.
loss_log
.
items
():
loss
+=
value
...
...
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