<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Meta Learning on eree's blog</title><link>https://blog.ereebay.me/tags/meta-learning/</link><description>Recent content in Meta Learning on eree's blog</description><generator>Hugo</generator><language>zh-cn</language><copyright>2020-2026 eree&amp;rsquo;s blog</copyright><lastBuildDate>Fri, 10 Jan 2020 11:31:05 +0800</lastBuildDate><atom:link href="https://blog.ereebay.me/tags/meta-learning/index.xml" rel="self" type="application/rss+xml"/><item><title>CS330 lecture 1&amp;2 学习笔记【未完】</title><link>https://blog.ereebay.me/posts/cs330-1/</link><pubDate>Fri, 10 Jan 2020 11:31:05 +0800</pubDate><guid>https://blog.ereebay.me/posts/cs330-1/</guid><description>&lt;h1 id="cs330-lecture-12-notes"&gt;CS330 lecture 1&amp;amp;2 notes&lt;/h1&gt;
&lt;h2 id="informal-problem-definitions"&gt;Informal Problem Definitions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The multi-task learning problem: Learn all of the tasks more quickly or more proficiently than learning them independently.(更快更专业学习所有任务)&lt;/li&gt;
&lt;li&gt;The meta-learning problem: Given data/experience on previous tasks, learn a new task more quickly and/or more proficiently.（依照先前任务的经验，更快更好的学习新任务）&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- more --&gt;
&lt;h2 id="multi-task-learning-basics"&gt;Multi-Task Learning Basics&lt;/h2&gt;
&lt;p&gt;传统单任务学习 Single-task learning:&lt;/p&gt;
&lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;semantics&gt;&lt;mtable rowspacing="0.16em" columnalign="left" columnspacing="1em"&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mstyle scriptlevel="0" displaystyle="false"&gt;&lt;mrow&gt;&lt;mi mathvariant="script"&gt;D&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo fence="true"&gt;{&lt;/mo&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi mathvariant="bold"&gt;x&lt;/mi&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;mi mathvariant="bold"&gt;y&lt;/mi&gt;&lt;msub&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mi&gt;k&lt;/mi&gt;&lt;/msub&gt;&lt;mo fence="true"&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;/mstyle&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;mtr&gt;&lt;mtd&gt;&lt;mstyle scriptlevel="0" displaystyle="false"&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mrow&gt;&lt;mi&gt;min&lt;/mi&gt;&lt;mo&gt;⁡&lt;/mo&gt;&lt;/mrow&gt;&lt;mi&gt;θ&lt;/mi&gt;&lt;/msub&gt;&lt;mi mathvariant="script"&gt;L&lt;/mi&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi&gt;θ&lt;/mi&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;mi mathvariant="script"&gt;D&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mstyle&gt;&lt;/mtd&gt;&lt;/mtr&gt;&lt;/mtable&gt;&lt;annotation encoding="application/x-tex"&gt;
\begin{array}{l}{\mathscr{D}=\left\{(\mathbf{x}, \mathbf{y})_{k}\right\}} \\ {\min _{\theta} \mathscr{L}(\theta, \mathscr{D})}\end{array}
&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;p&gt;损失函数 Typical loss: negative log likelihood&lt;/p&gt;
&lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant="script"&gt;L&lt;/mi&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi&gt;θ&lt;/mi&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;mi mathvariant="script"&gt;D&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;msub&gt;&lt;mi mathvariant="double-struck"&gt;E&lt;/mi&gt;&lt;mrow&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mo&gt;∼&lt;/mo&gt;&lt;mi mathvariant="script"&gt;D&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mrow&gt;&lt;mo fence="true"&gt;[&lt;/mo&gt;&lt;mi&gt;log&lt;/mi&gt;&lt;mo&gt;⁡&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mi&gt;θ&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi mathvariant="bold"&gt;y&lt;/mi&gt;&lt;mi mathvariant="normal"&gt;∣&lt;/mi&gt;&lt;mi mathvariant="bold"&gt;x&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mo fence="true"&gt;]&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt;
\mathscr{L}(\theta, \mathscr{D})=-\mathbb{E}_{(x, y) \sim \mathscr{D}}\left[\log f_{\theta}(\mathbf{y} | \mathbf{x})\right]
&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;h3 id="whats-a-task"&gt;What&amp;rsquo;s a task?&lt;/h3&gt;
&lt;p&gt;A task: &lt;span class="katex"&gt;&lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi mathvariant="script"&gt;T&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;/msub&gt;&lt;mo&gt;≜&lt;/mo&gt;&lt;mrow&gt;&lt;mo fence="true"&gt;{&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi mathvariant="bold"&gt;x&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;p&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;/msub&gt;&lt;mo stretchy="false"&gt;(&lt;/mo&gt;&lt;mi mathvariant="bold"&gt;y&lt;/mi&gt;&lt;mi mathvariant="normal"&gt;∣&lt;/mi&gt;&lt;mi mathvariant="bold"&gt;x&lt;/mi&gt;&lt;mo stretchy="false"&gt;)&lt;/mo&gt;&lt;mo separator="true"&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi mathvariant="script"&gt;L&lt;/mi&gt;&lt;mi&gt;i&lt;/mi&gt;&lt;/msub&gt;&lt;mo fence="true"&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/mrow&gt;&lt;annotation encoding="application/x-tex"&gt;\mathscr{T}_{i} \triangleq\left\{p_{i}(\mathbf{x}), p_{i}(\mathbf{y} | \mathbf{x}), \mathscr{L}_{i}\right\}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;/p&gt;</description><content:encoded><![CDATA[<h1 id="cs330-lecture-12-notes">CS330 lecture 1&amp;2 notes</h1>
<h2 id="informal-problem-definitions">Informal Problem Definitions</h2>
<ul>
<li>The multi-task learning problem: Learn all of the tasks more quickly or more proficiently than learning them independently.(更快更专业学习所有任务)</li>
<li>The meta-learning problem: Given data/experience on previous tasks, learn a new task more quickly and/or more proficiently.（依照先前任务的经验，更快更好的学习新任务）</li>
</ul>
<!-- more -->
<h2 id="multi-task-learning-basics">Multi-Task Learning Basics</h2>
<p>传统单任务学习 Single-task learning:</p>
<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mtable rowspacing="0.16em" columnalign="left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi mathvariant="script">D</mi><mo>=</mo><mrow><mo fence="true">{</mo><mo stretchy="false">(</mo><mi mathvariant="bold">x</mi><mo separator="true">,</mo><mi mathvariant="bold">y</mi><msub><mo stretchy="false">)</mo><mi>k</mi></msub><mo fence="true">}</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msub><mrow><mi>min</mi><mo>⁡</mo></mrow><mi>θ</mi></msub><mi mathvariant="script">L</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><mi mathvariant="script">D</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">
\begin{array}{l}{\mathscr{D}=\left\{(\mathbf{x}, \mathbf{y})_{k}\right\}} \\ {\min _{\theta} \mathscr{L}(\theta, \mathscr{D})}\end{array}
</annotation></semantics></math></span><p>损失函数 Typical loss: negative log likelihood</p>
<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">L</mi><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><mi mathvariant="script">D</mi><mo stretchy="false">)</mo><mo>=</mo><mo>−</mo><msub><mi mathvariant="double-struck">E</mi><mrow><mo stretchy="false">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo stretchy="false">)</mo><mo>∼</mo><mi mathvariant="script">D</mi></mrow></msub><mrow><mo fence="true">[</mo><mi>log</mi><mo>⁡</mo><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy="false">(</mo><mi mathvariant="bold">y</mi><mi mathvariant="normal">∣</mi><mi mathvariant="bold">x</mi><mo stretchy="false">)</mo><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">
\mathscr{L}(\theta, \mathscr{D})=-\mathbb{E}_{(x, y) \sim \mathscr{D}}\left[\log f_{\theta}(\mathbf{y} | \mathbf{x})\right]
</annotation></semantics></math></span><h3 id="whats-a-task">What&rsquo;s a task?</h3>
<p>A task: <span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">T</mi><mi>i</mi></msub><mo>≜</mo><mrow><mo fence="true">{</mo><msub><mi>p</mi><mi>i</mi></msub><mo stretchy="false">(</mo><mi mathvariant="bold">x</mi><mo stretchy="false">)</mo><mo separator="true">,</mo><msub><mi>p</mi><mi>i</mi></msub><mo stretchy="false">(</mo><mi mathvariant="bold">y</mi><mi mathvariant="normal">∣</mi><mi mathvariant="bold">x</mi><mo stretchy="false">)</mo><mo separator="true">,</mo><msub><mi mathvariant="script">L</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\mathscr{T}_{i} \triangleq\left\{p_{i}(\mathbf{x}), p_{i}(\mathbf{y} | \mathbf{x}), \mathscr{L}_{i}\right\}</annotation></semantics></math></span></p>
<p>data generating distributions</p>
<p>这里将任务定义成，数据样本的分布，数据标签的分布和损失函数</p>
<p>Corresponding datsets:<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">D</mi><mi>i</mi><mrow><mi>t</mi><mi>r</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mathscr{D}_{i}^{tr}</annotation></semantics></math></span> 训练集<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">D</mi><mi>i</mi><mrow><mi>t</mi><mi>s</mi><mi>t</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mathscr{D}_{i}^{t s t}</annotation></semantics></math></span>测试集
通常用<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">D</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\mathscr{D}_{i}</annotation></semantics></math></span>表示训练集</p>
<p>Multi-task classification：<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">L</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\mathscr{L}_{i}</annotation></semantics></math></span> same across all tasks 例如：每种语言的手写识别中，损失函数的形式可能相同</p>
<p>Multi-label learning:<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">L</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>p</mi><mi>i</mi></msub><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\mathscr{L}_{i}, {p}_{i}(x)</annotation></semantics></math></span> same across all tasks 例如：CelebA 多标签识别任务中，样本和损失函数都是相同的</p>
<p>在以下任务中损失函数可能会发生不同的变化：</p>
<ul>
<li>mixed discrete， continuous labels across tasks（混了了离散和连续的标签的任务）</li>
<li>care more about one task than another（任务之间权重不同？）</li>
</ul>
<h3 id="conditioning-on-the-task">Conditioning on the task</h3>
<p>对于multi task learning的问题需要引入一个task descriptor作为描述任务的变量，那么如何设计这个变量。</p>
<p>假设<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">{z}_{i}</annotation></semantics></math></span>是task index，那么最直接的办法就是multiplicative gating，也就使得这个多任务学习中的每个任务是独立的用单独网络训练而不分享参数。</p>
<p>那么另一种极端就是直接concat<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">z_i</annotation></semantics></math></span>,那样所有参数都会被共享，除了输入<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">z_i</annotation></semantics></math></span>之后的参数。</p>
<p>那么另一种思路就是吧<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span>分为shared parameters <span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>θ</mi><mrow><mi>s</mi><mi>h</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\theta^{sh}</annotation></semantics></math></span>和task-specific parametes <span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>θ</mi><mi>i</mi></msup></mrow><annotation encoding="application/x-tex">\theta^i</annotation></semantics></math></span>也就是共享参数和不共享参数</p>
<p>那么优化目标就变成了</p>
<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>min</mi><mo>⁡</mo></mrow><mrow><msup><mi>θ</mi><mrow><mi>s</mi><mi>h</mi></mrow></msup><mo separator="true">,</mo><msup><mi>θ</mi><mn>1</mn></msup><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msup><mi>θ</mi><mi>T</mi></msup></mrow></msub><msubsup><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>T</mi></msubsup><msub><mi mathvariant="script">L</mi><mi>i</mi></msub><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msup><mi>θ</mi><mrow><mi>s</mi><mi>h</mi></mrow></msup><mo separator="true">,</mo><msup><mi>θ</mi><mi>i</mi></msup><mo fence="true">}</mo></mrow><mo separator="true">,</mo><msub><mi mathvariant="script">D</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">
\min _{\theta^{s h}, \theta^{1}, \ldots, \theta^{T}} \sum_{i=1}^{T} \mathscr{L}_{i}\left(\left\{\theta^{s h}, \theta^{i}\right\}, \mathscr{D}_{i}\right)
</annotation></semantics></math></span><p>问题就转化成了如何选择和什么时候共享参数</p>
<h4 id="common-choices">Common Choices</h4>
<p>常用的方法主要有拼接和加法，看图一目了然</p>
<ol>
<li>Concatenation-based conditioning（拼接)</li>
</ol>
<p><img alt="cs330-1-1.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-1.png"></p>
<ol start="2">
<li>Additive conditioning（加法）</li>
</ol>
<p><img alt="cs330-1-2.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-2.png"></p>
<p>实际上两者是等同的</p>
<p><img alt="cs330-1-3.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-3.png"></p>
<ol start="3">
<li>Multi-head architecture</li>
</ol>
<p><img alt="cs330-1-4.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-4.png"></p>
<ol start="4">
<li>Multiplicative conditioning</li>
</ol>
<p><img alt="cs330-1-5.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-5.png"></p>
<p>乘法的方法可以带来</p>
<ul>
<li>更强的表达能力</li>
<li>对于回归任务，有multiplication gating</li>
<li>能够对于独立的网络和heads进行更好的泛化</li>
</ul>
<h4 id="complex-choices">Complex Choices</h4>
<p>还有许多其他复杂的方式</p>
<p><img alt="cs330-1-6.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-6.png"></p>
<p>但是设计的灵感来源问题就和神经网络的参数选择一样：</p>
<ul>
<li>不同问题之间是独立的</li>
<li>对于特定的问题，主要依靠设计者的直觉和背景知识</li>
<li>目前解决的方法更像是艺术而非科学</li>
</ul>
<h3 id="optimizing-the-objective">Optimizing the objective</h3>
<p>Objective:<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>min</mi><mo>⁡</mo></mrow><mi>θ</mi></msub><msubsup><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>T</mi></msubsup><msub><mi mathvariant="script">L</mi><mi>i</mi></msub><mrow><mo fence="true">(</mo><mi>θ</mi><mo separator="true">,</mo><msub><mi mathvariant="script">D</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\min _{\theta} \sum_{i=1}^{T} \mathscr{L}_{i}\left(\theta, \mathscr{D}_{i}\right)</annotation></semantics></math></span></p>
<p>一般的流程：</p>
<ol>
<li>从tasks中采样一个minibatch<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">B</mi><mo>∼</mo><mrow><mo fence="true">{</mo><msub><mi mathvariant="script">T</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\mathscr{B} \sim\left\{\mathscr{T}_{i}\right\}</annotation></semantics></math></span></li>
<li>从每个task中采样一个minibatch的数据样本<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">D</mi><mi>i</mi><mi>b</mi></msubsup><mo>∼</mo><msub><mi mathvariant="script">D</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\mathscr{D}_{i}^{b} \sim \mathscr{D}_{i}</annotation></semantics></math></span></li>
<li>在每个minibatch-task上计算loss：<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi mathvariant="script">L</mi><mo>^</mo></mover><mo stretchy="false">(</mo><mi>θ</mi><mo separator="true">,</mo><mi mathvariant="script">B</mi><mo stretchy="false">)</mo><mo>=</mo><msub><mo>∑</mo><mrow><msub><mi mathvariant="script">T</mi><mi>k</mi></msub><mo>∈</mo><mi mathvariant="script">B</mi></mrow></msub><msub><mi mathvariant="script">L</mi><mi>k</mi></msub><mrow><mo fence="true">(</mo><mi>θ</mi><mo separator="true">,</mo><msubsup><mi mathvariant="script">D</mi><mi>k</mi><mi>b</mi></msubsup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\hat{\mathscr{L}}(\theta, \mathscr{B})=\sum_{\mathcal{T}_{k} \in \mathscr{B}} \mathscr{L}_{k}\left(\theta, \mathscr{D}_{k}^{b}\right)</annotation></semantics></math></span></li>
<li>反向传播计算梯度<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">∇</mi><mi>θ</mi></msub><mover accent="true"><mi mathvariant="script">L</mi><mo>^</mo></mover></mrow><annotation encoding="application/x-tex">\nabla_{\theta} \hat{\mathscr{L}}</annotation></semantics></math></span></li>
<li>采用你喜欢的优化器更新梯度</li>
</ol>
<p>Note：这样可以保证无论数据量如何，任务都可以被均匀采样
Tip:对于回归任务，确保任务标签是相同的scale</p>
<h3 id="challenge">Challenge</h3>
<ol>
<li>Negative transfer</li>
</ol>
<p>在cifar-100上进行多任务训练，不如独立训练。</p>
<p>可能的原因：</p>
<ul>
<li>来自优化方面的挑战
<ul>
<li>不同任务之间的相互干扰</li>
<li>不同任务的学习速率不同</li>
</ul>
</li>
<li>受限的表达能力
<ul>
<li>多任务网络体积较大</li>
</ul>
</li>
</ul>
<p>解决方法：</p>
<p>share less across task（软参数分享）</p>
<ul>
<li>allows for more luid degrees of parameter sharing 好处</li>
<li>yet another set of design decisions/hyperparameters 坏处</li>
</ul>
<span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>min</mi><mo>⁡</mo></mrow><mrow><msup><mi>θ</mi><mrow><mi>s</mi><mi>h</mi></mrow></msup><mo separator="true">,</mo><msup><mi>θ</mi><mn>1</mn></msup><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msup><mi>θ</mi><mi>T</mi></msup></mrow></msub><msubsup><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>T</mi></msubsup><msub><mi mathvariant="script">L</mi><mi>i</mi></msub><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msup><mi>θ</mi><mrow><mi>s</mi><mi>h</mi></mrow></msup><mo separator="true">,</mo><msup><mi>θ</mi><mi>i</mi></msup><mo fence="true">}</mo></mrow><mo separator="true">,</mo><msub><mi mathvariant="script">D</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo>+</mo><msubsup><mo>∑</mo><mrow><mi>t</mi><mo>=</mo><mn>1</mn></mrow><mi>T</mi></msubsup><mrow><mo fence="true">∥</mo><msup><mi>θ</mi><mi>t</mi></msup><mo>−</mo><msup><mi>θ</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></msup><mo fence="true">∥</mo></mrow></mrow><annotation encoding="application/x-tex">
\min _{\theta^{sh}, \theta^{1}, \ldots, \theta^{T}} \sum_{i=1}^{T} \mathscr{L}_{i}\left(\left\{\theta^{s h}, \theta^{i}\right\}, \mathscr{D}_{i}\right)+\sum_{t=1}^{T}\left\|\theta^{t}-\theta^{t&#x27;}\right\|
</annotation></semantics></math></span><p>后面的部分就是软参数分享，就是将第二个task的参数和前一个的差作为优化项，相当于让每个task的参数尽可能相似，也就是分享了参数。</p>
<ol start="2">
<li>Overfitting</li>
</ol>
<p>过拟合原因一般是由于，参数共享的不够多，解决方案就是参数分享的更多一些。可以理解为，分享的不够，使得每个task都过拟合了，类似于独立训练了。</p>
<h2 id="meta-learning-basics">Meta-Learning Basics</h2>
<p>元学习的两种视角</p>
<ul>
<li>Mechanistic view （机制视角）
<ul>
<li>可以读取整个数据集并且对新的数据进行预测的深度神经网络</li>
<li>利用元数据集对网络进行训练，并且这种元数据集针对不同的任务包含了不同的数据集</li>
<li>这种视角可以容易实现一个元学习算法。</li>
</ul>
</li>
<li>Probabilistic view（概率视角）
<ul>
<li>从一系列元学习任务重提取先验知识</li>
<li>使用少量的数据和先验信息推测出相对有效的后验参数</li>
<li>这种视角可以更好地理解元学习算法</li>
</ul>
</li>
</ul>
<h3 id="problem-definitions">Problem definitions</h3>
<p>首先回顾一下监督学习：
<img alt="cs330-1-7.png" loading="lazy" src="http://cdn.ereebay.me/hexo/cs330-1-7.png"></p>
<p>存在的问题：</p>
<ul>
<li>需要大量的标记数据</li>
<li>目前的某些任务数据标签很有限</li>
</ul>
<p>To be continued</p>
]]></content:encoded></item></channel></rss>