torch_maml icon indicating copy to clipboard operation
torch_maml copied to clipboard

about maml.py

Open Balding-Lee opened this issue 2 years ago • 6 comments

In maml.py line 105 and 106, the code is

fast_weights = collections.OrderedDict((name, param - args.inner_lr * grads)
                                                   for ((name, param), grads) in zip(fast_weights.items(), grads))

is there any wrong in it? I mean, should it be

fast_weights = collections.OrderedDict((name, param - args.inner_lr * grad)
                                                   for ((name, param), grad) in zip(fast_weights.items(), grads))

Balding-Lee avatar Jan 09 '24 08:01 Balding-Lee

In maml.py line 105 and 106, the code is

fast_weights = collections.OrderedDict((name, param - args.inner_lr * grads)
                                                   for ((name, param), grads) in zip(fast_weights.items(), grads))

is there any wrong in it? I mean, should it be

fast_weights = collections.OrderedDict((name, param - args.inner_lr * grad)
                                                   for ((name, param), grad) in zip(fast_weights.items(), grads))

Yes, you are right. I will fix this bug.

Runist avatar Jan 11 '24 07:01 Runist

非常感谢作者回复,BTW,我想再多问几个问题:

  1. 如果我要做测试的话,那么我是照样将测试集划分为支持集与查询集,然后用支持集进行梯度下降,然后在查询集上计算准确率么?
  2. 如果是这样的话,那么我的对比实验应该怎么做呢?针对其他非MAML-based model,我也只单独把测试集中的查询集拿出来,让这些模型在这个查询集上跑准确率这些么?

Balding-Lee avatar Jan 11 '24 08:01 Balding-Lee

其实对比其他方法的时候,别的方法一般是使用预训练权重,那么我们理论上是所有有监督的数据集,随机选取N个类就可以开始训了,然后这样选取若干次,一直训练,得到的权重就是泛化性很强的权重。那这个时候我们只需要在我们特地的数据集上去做同样次数的训练,就能和其他方法比对了。

Runist avatar Jan 15 '24 07:01 Runist

所以相当于就算是采用MAML的方法,也不能将测试集划分为支持集与查询集,而是直接用其他任务上训练好的权重来做测试对吧?

Balding-Lee avatar Jan 15 '24 07:01 Balding-Lee

你可以分,只不过没必要,因为只要是你的测试集没在训练集里面出现过就行

Runist avatar Jan 15 '24 08:01 Runist

好的好的,谢谢作者的回复~

Balding-Lee avatar Jan 15 '24 08:01 Balding-Lee