Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yaoyao Liu
E3BM
Commits
ae4e779a
Commit
ae4e779a
authored
Apr 11, 2021
by
Yaoyao Liu
Browse files
Update meta_trainer.py
parent
801b6c53
Changes
1
Hide whitespace changes
Inline
Side-by-side
trainer/meta_trainer.py
View file @
ae4e779a
...
...
@@ -362,8 +362,7 @@ class MetaTrainer(object):
p
=
args
.
shot
*
args
.
way
data_shot
,
data_query
=
data
[:
p
],
data
[
p
:]
data_shot
=
data_shot
.
unsqueeze
(
0
).
repeat
(
num_gpu
,
1
,
1
,
1
,
1
)
logits
=
model
(
(
data_shot
,
data_query
))
logits
=
model
.
meta_forward
(
data_shot
,
data_query
)
loss
=
F
.
cross_entropy
(
logits
,
label
)
acc
=
count_acc
(
logits
,
label
)
vl
.
add
(
loss
.
item
())
...
...
Write
Preview
Supports
Markdown
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