Skip to content

Commit

Permalink
Fix double error normalisation in maml example (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsakFalk authored Oct 23, 2020
1 parent 76fb944 commit c402014
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions examples/vision/maml_miniimagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ def fast_adapt(batch, learner, loss, adaptation_steps, shots, ways, device):
# Adapt the model
for step in range(adaptation_steps):
adaptation_error = loss(learner(adaptation_data), adaptation_labels)
adaptation_error /= len(adaptation_data)
learner.adapt(adaptation_error)

# Evaluate the adapted model
predictions = learner(evaluation_data)
evaluation_error = loss(predictions, evaluation_labels)
evaluation_error /= len(evaluation_data)
evaluation_accuracy = accuracy(predictions, evaluation_labels)
return evaluation_error, evaluation_accuracy

Expand Down

0 comments on commit c402014

Please sign in to comment.