論文筆記:Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks


Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks

ICML 2017

 

Paperhttps://arxiv.org/pdf/1703.03400.pdf

Code for the regression and supervised experimentshttps://github.com/cbfinn/maml

Code for the RL experimentshttps://github.com/cbfinn/maml_rl 

 

Abstract:

我們提出一種 meta-learning 算法,該算法是模型無關的,適用於任何利用梯度下降的方法來訓練的模型,並且適用於任何任務,包括:classification,regression,and reinforcement learning. meta-learning 的目標是在不同的任務上訓練一個模型,使得該模型可以僅僅利用少量的數據,就可以解決新的任務。在我們的方法中,該模型的參數,是顯示的進行訓練的,這樣的話,a small number of gradient steps with a small amount of training data from a new task will produce good generalization performance on that task. 效果上來說,我們的方法得到的模型更加容易進行微調。我們表明這種方法可以在兩個 few-shot image classification benchmarks 得到頂尖的效果,並且加速了策略梯度強化學習算法。

 

Introduction

如何快速的進行學習是最近機器學習領域的一個研究熱點問題。我們人類可以根據已有的先驗知識,就可以根據少量新的信息,快速的掌握一項新的技能。如,會寫普通鋼筆字的人,可能很快就會寫毛筆字。但是這種快速且靈活的學習任務對於機器來說,確是非常困難的。因為:智能體必須將少量新的信息與其先驗知識結合起來,與此同時,避免對於新的數據過擬合。此外,這種先驗經歷以及新的數據的格式將會依賴於 task。

本文提出一種 general 的並且與模型無關的 meta-learning algorithm,可以直接應用於任何基於策略梯度的方法中。我們集中於 deep neural network models, 但是我們的模型也可以通過微小的改變就很容易處理不同的結構,以及不同的問題設定,如分類,回歸,策略梯度強化學習。在 meta-learning 中,所訓練的模型的目標是:快速的從少量新的數據上學習一個新的任務,然后該模型通過 meta-learner 來訓練,使得能夠在大量不同的任務上進行學習。

本文方法的 key idea 是:train the model's initial parameters such that the model has maximal performance on a new task after the parameters have been updated through one or more gradient steps computed with a small amount of data from that new task. 與前人的工作不同,他們通常基於 learn an update function or learning rule, 我們的方法不會增加所需要學習參數的數量,也不會限制模型的框架,可以很容易與各種全連接,全卷積,或者循環神經網絡。也可以與各種損失函數結合,如:可微分的監督損失函數,或者不可導的強化學習目標函數。

 

訓練一個模型參數的過程,使得一些梯度步驟,甚至是單步梯度步驟,可以在一個新的任務上,產生較好的效果,可以看做是構建中間表達,廣泛的適用於許多任務。如果該中間表達適應於許多任務,簡單的微調該參數,可以產生較好的結果。實際上,我們的參數優化是非常簡單,並且快速進行微調的,使得 adaptation 可以在合適的空間進行快速學習。從一個動態系統的角度,我們的學習過程可以看做是:maximizing the sensitivity of the loss functions of new tasks with respect to the parameters: 當敏感度高的時候,對參數進行較小的局部改變可以帶來任務損失上大的改善。

 

該任務較大的貢獻在於:a simple model-and task-agnostic algorithmm for meta-learning that trains a model's parameters such that a small number of gradient updates will lead to fast learning on a new task.

 

Model-Agnostic Meta-Learning: 

1. Meta-Learning Problem Setup

Few-shot meta-learning 的目標是:學習一個模型,僅僅通過少量數據以及訓練迭代次數,就使其能夠快速適應於新的任務。

我們考慮一個模型,表示為 f,將觀測數據 x 映射為 a。在 meta-learning 的過程中,該模型被訓練使得能夠適應於大量或者有限的任務。因為我們將會應用於不同的學習任務,從分類到強化學習,我們引入一個 generic 的學習任務。正式的說,每一個任務:

包含損失函數 L基於初始觀測的分布 q(x1)轉移分布 q(xt+1|xt, at),以及 episode 長度 H

在獨立同分布的監督學習問題中,長度 H = 1. 

在我們 meta-learning 場景下,我們考慮一個基於任務的分布。

 

2. A Model-Agnostic Meta-Learning Algorithm: 

與前人的方法不同,我們提出一種方法,可以學習任何標准模型的參數,通過 meta-learning,使該模型可以准備好進行 fast adaptation。這個方法的直觀原因是:some internal representations are more transferrable than others. 例如,一個神經網絡可能學習到 internal features,廣泛的應用於所有的任務,而不是 single individual task。那么,我們如何鼓勵這種 general-purpose representations?我們采用了一種直觀的方法來解決這一問題:由於這個model 將會用基於梯度的方法在一個 new task 上進行微調,所以,我們將會瞄准使得學習到 model 具有下面的性質,this gradient-based learning rule can make rapid progress on new tasks drawn from p(T),whithout overfitting. 在實際操作中,我們的目標是知道一組模型參數,在當前任務中對 changes 是敏感的,使得較小的參數改變,任何任務的損失函數都會得到大幅度的改善,當改變 loss 的梯度方向時,如圖1 所示(we will aim to find model parameters that are sensitive to changes in the task, such that small changes iin the parameters will produce large improvements on the loss function of any task drawn from p(T), when altered in the direction of the gradient of that loss). 我們不對該模型的形式做任何假設。

正式的,我們考慮一個模型,$f_{\theta}$,其參數為 $\theta$。當適應一個新的任務時 Ti, 模型的參數變為 $\theta'$。在我們的方法中,更新后的參數 $\theta'$ 是用一次或者多次在任務 Ti 上進行梯度更新得到的。例如,當進行一次梯度更新時:

此處,step size $\alpha$ 可以被固定為超參數,或者 meta-learned。為了符號的簡化,我們將會考慮 one gradient update,但是也可以很直接的進行多次梯度更新。

The model parameters are trained by optimizing for the performance of $f_\theta'$ with respect to $\theta$ across tasks sampled from p(T). 具體來說,the meta-objective 被定義為:

注意到,the meta-optimization 是通過 model parameters $\theta$ 來實現的,其中,模型被用新的模型參數 $\theta'$ 進行計算。實際上,我們提出的模型,目標是優化模型的參數,使得 one or a small number of gradient steps on a new task will produce maximally effective behavior on that task. 

 

The meta-optimization 在不同任務之間被執行,是通過 SGD 進行的,使得模型的參數 $\theta$ 被通過如下的方式進行更新:

其中,$\beta$ 是 meta step size。整個算法,可以在 Algorithm 1 中找到。

The MAML meta-gradient update 涉及到 a gradient through a gradient. 計算上來說,這需要一個額外的反向傳播,通過 f 來計算 Hessian-vector product, 這個很多深度學習框架都支持自動梯度計算,以及反向傳播。

 

Species of MAML:

1. Supervised Regression and Classification:  

Few-shot learning 是監督任務中被很好的研究了的課題,學習的目標就是從少量輸入/輸出對來學習一個新的函數,從相似的任務中利用先驗知識進行 meta-learning。在 few-shot regression 中,學習的目標是: predict the outputs of a continuous-valued function from only a few datapoints sampled from that function, after training on many functions with similar statistical properties。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

==


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM