Skip to content

Commit c402014

Browse files
authored
Fix double error normalisation in maml example (#196)
1 parent 76fb944 commit c402014

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

examples/vision/maml_miniimagenet.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ def fast_adapt(batch, learner, loss, adaptation_steps, shots, ways, device):
4343
# Adapt the model
4444
for step in range(adaptation_steps):
4545
adaptation_error = loss(learner(adaptation_data), adaptation_labels)
46-
adaptation_error /= len(adaptation_data)
4746
learner.adapt(adaptation_error)
4847

4948
# Evaluate the adapted model
5049
predictions = learner(evaluation_data)
5150
evaluation_error = loss(predictions, evaluation_labels)
52-
evaluation_error /= len(evaluation_data)
5351
evaluation_accuracy = accuracy(predictions, evaluation_labels)
5452
return evaluation_error, evaluation_accuracy
5553

0 commit comments

Comments
 (0)