You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am running the toy_example.py and printing out the loss and adapt_loss as shown below.
for t in range(TASKS_PER_STEP):
# Sample a task
task_params = task_dist.sample()
mu_i, sigma_i = task_params[:DIM], task_params[DIM:]
# Adaptation: Instanciate a copy of model
learner = maml.clone()
proposal = learner()
# Adaptation: Compute and adapt to task loss
loss = (mu_i - proposal.mean).pow(2).sum() + (sigma_i - proposal.variance).pow(2).sum()
learner.adapt(loss)
print(loss)
# Adaptation: Evaluate the effectiveness of adaptation
adapt_loss = (mu_i - proposal.mean).pow(2).sum() + (sigma_i - proposal.variance).pow(2).sum()
print(adapt_loss)
# Accumulate the error over all tasks
step_loss += adapt_loss
However, I'm receiving the same adapt_loss and loss at every timestep. I'm also looking at the parameters inside the maml, proposal, and learner. I see that the proposal and maml have the same parameters but the learner.module._parameters are different. Am I understanding that the proposal and maml model should have different parameters after learner.adapt is called?
Thank you so much!
The text was updated successfully, but these errors were encountered:
xunil17
changed the title
Parameters of cloned learner is not updating parameters
Parameters of cloned learner is not updating
Oct 28, 2023
Hello, I am running the
toy_example.py
and printing out the loss and adapt_loss as shown below.However, I'm receiving the same adapt_loss and loss at every timestep. I'm also looking at the parameters inside the maml, proposal, and learner. I see that the proposal and maml have the same parameters but the learner.module._parameters are different. Am I understanding that the proposal and maml model should have different parameters after learner.adapt is called?
Thank you so much!
The text was updated successfully, but these errors were encountered: