Reptile: On First-Order Meta-Learning Algorithms

On First-Order Meta-Learning Algorithms

Paper:https://arxiv.org/pdf/1803.02999.pdf
Code:https://github.com/openai/supervised-reptile
Tips:OpenAi的一篇相似MAML的Meta-learning相關的paper。
(閱讀筆記)

1.Main idea

  • 目標旨在實現相同分佈的一類任務的少量樣本快速學習。This paper considers meta-learning problems, where there is a distribution of tasks, and we would like to obtain an agent that performs well (i.e., learns quickly) when presented with a previously unseen task sampled from this distribution.
  • 類似於first-order MAML,忽略了二階偏微分。並且指出了其實現更爲簡單。
  • Reptile的作爲meta-learning的方法,訓練還是和傳統方法很相似。Reptile is so similar to joint training that it is especially surprising that it works as a meta-learning algorithm.
  • 做出了first-order MAML和reptile的理論分析。

2.MAML回顧

回顧了MAML相關工作。
目標是求解下式,其中τ\tau是不同的任務集,ϕ\phi是初始參數,LL是損失函數,UτkU_{\tau}^{k}表示從任務集τ\tau抽樣出來訓練的第kk次的參數更新操作:
minϕEτ[Lτ(Uτk(ϕ))] \min_{\phi}\mathbb{E}_{\tau}[L_{\tau}(U_{\tau}^{k}(\phi)) ]
AA是原始訓練任務集,BB是新任務集。MAML的訓練操作仍然對原始任務集進行訓練,但是其損失函數卻是針對的BB,如下所示:
minϕEτ[Lτ,B(Uτ,A(ϕ))] \min_{\phi}\mathbb{E}_{\tau}[L_{\tau,B}(U_{\tau,A}(\phi)) ]
找梯度即需對參數ϕ\phi求偏導(複合函數求導):
g=Lτ,B(Uτ,A(ϕ))ϕ=Lτ,B(Uτ,A(ϕ))×Uτ,A(ϕ)=Lτ,B(Uτ,A(ϕ))Uτ,A(ϕ)×Uτ,A(ϕ)ϕ g=\frac{\partial L_{\tau,B}(U_{\tau,A}(\phi))}{\partial \phi}\\ \\=L_{\tau,B}'(U_{\tau,A}(\phi)) \times U_{\tau,A}'(\phi)=\frac{\partial L_{\tau,B}(U_{\tau,A}(\phi))}{\partial U_{\tau,A}(\phi)} \times \frac{\partial U_{\tau,A}(\phi)}{\partial \phi}
使用恆等操作(對第二項偏微分變爲常量1),得到First-order MAML爲:
g=Lτ,B(Uτ,A(ϕ))Uτ,A(ϕ) g=\frac{\partial L_{\tau,B}(U_{\tau,A}(\phi))}{\partial U_{\tau,A}(\phi)}
即損失下降梯度的方向爲在任務集AA得到參數ϕ\phi的情況下,通過對測試集BB得到的損失最小化的方向即是外循環的方向。

3.Reptile

  • 算法流程如下所示:
    在這裏插入圖片描述
    注意到可以一次迭代中將ϕ~\widetilde{\phi}進行kk步後,最後才確定梯度的方向。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章