Hi all,
I was going through the code of Few Shot Learning with Reptile on Omniglot dataset..
In the code of evaluation, I observed that the weights of the model have been stored in a variable “old_var” and without changing the weights, model.set_weights(old_var) has been performed. I didn’t understand the logic. What is the significance of setting the same weights?
Can someone please help me to clear the doubt?
Thanks in advance
Hi @rejoycs99,
Sorry for the delay in response.
In Reptile algorithm, the model’s weights are updated after each task during the inner loop. This old_var
variable keeps a copy of the model’s weights before any updates for a specific task. When evaluating, model.set_weights(old_var)
restores the model to its original state, ensuring the evaluation is based on its performance before any task-specific learning and this could prevents any bias from prior updates and allows for a fair test of how well the model can generalize to new and unseen tasks.
Hope this helps.Thank You.