AI Wiki中文/EN

wav2vec 2.0:先学语音目标,再学转写

Wav2vec 2.0

区分遮盖上下文与Gumbel目标,推导对比梯度、码本多样性和时间几何,运行完整小例子。

本页目录直觉理解数学与方法代码实现局限与误解实验与练习研究脉络

没有转写,录音本身能教会模型什么?

假设有很多录音,却只有一小部分带人工转写。只用这些转写训练识别器,不能直接把其余录音都当成带标签样本。wav2vec 2.0从音频本身构造预训练任务:遮住连续表示的一部分,再从候选中找出对应的学习型离散目标;之后的有监督阶段仍负责建立到文字符号的联系。预训练与微调

名称需要分清。本篇讨论2020年的wav2vec 2.0,不将更早的wav2vec、vq-wav2vec或后续无监督识别变体混用。离散码是训练目标,不是已经给定的词,也不保证构成音素表;上下文网络接收的仍是连续特征。模型结构

小例子会出现一个值得推算的现象:码本的概率perplexity达到最大值,确定性选择却一直取第一项。要解释它,必须区分软概率、硬选择和带噪训练采样。下面先把这些量拆开,再实现损失与导数。

软概率perplexity与硬argmax使用可能不同。供给向量损失、跨度重叠和卷积时间分别回答不同问题,都不是识别成绩。
软概率perplexity与硬argmax使用可能不同。供给向量损失、跨度重叠和卷积时间分别回答不同问题,都不是识别成绩。

上下文支路与目标支路要分开

特征编码器ff把波形XX变成连续向量序列ZZ。破坏操作rr先替换遮盖集合MM中的位置,再送入上下文网络gg;目标支路量化的则是未遮盖特征。比较之前,上下文与目标的投影必须给出相同维度:

zt=f(X)t,ct=g(r(Z,M))t,qt=Wq[e1,it1;…;eG,itG].z_t=f(X)_t,\qquad c_t=g(r(Z,M))_t,\qquad q_t=W_q[e_{1,i_{t1}};\ldots;e_{G,i_{tG}}].

eg,ve_{g,v}表示第gg组码本的第vv项,分号表示拼接。GG组、每组VV项至多有VGV^G种索引组合,但训练不一定使用全部组合,也不保证每个组合向量都不同。本记法的gg包含需要的上下文投影。原方法使用卷积波形编码器、Transformer上下文网络和卷积位置信息;实验配置之间的归一化有差异,不能用一句通用结构描述代替全部checkpoint配置。结构与配置

如果连目标支路也遮住,就会改变或删除用于定义预测目标的信息。遮盖起点数也不等于被遮帧数,因为多个跨度可以重叠。独立mask例子取长度12、起点2和4、跨度4,合并后只有索引2至7共6帧,不是8帧;这里只说明重叠,没有复现所有随机mask与padding规则。

量化器把特征映射到logits ltgvl_{tgv}。显式均匀随机数u∈(0,1)u\in(0,1)生成Gumbel噪声,再做带温度的softmax:

ntgv=−ln⁡(−ln⁡utgv),ptgv=exp⁡((ltgv+ntgv)/τ)∑jexp⁡((ltgj+ntgj)/τ),itg=arg⁡max⁡vptgv,τ>0.n_{tgv}=-\ln(-\ln u_{tgv}),\quad p_{tgv}=\frac{\exp((l_{tgv}+n_{tgv})/\tau)}{\sum_j\exp((l_{tgj}+n_{tgj})/\tau)},\quad i_{tg}=\arg\max_v p_{tgv},\quad \tau>0.

所查论文式1把温度排在exp括号外,按字面读取会在分子分母约掉。本篇明确写在指数内部,对应固定PyTorch实现先用温度除logits加噪声、再softmax的顺序。固定带噪logits时,改变正的τ\tau会改变软概率,却不改变argmax;零温度可以作为极限讨论,不能直接作为本实现的分母。Gumbel操作

硬选择对logits是分段常数。在远离边界的地方,小幅扰动的普通导数因此为0。直通训练有意保留硬前向值,却替换成软反向导数:

w=stopgrad⁡(onehot⁡(arg⁡max⁡p)−p)+p,∂p∂l=diag⁡(p)−pp⊤τ.w=\operatorname{stopgrad}(\operatorname{onehot}(\arg\max p)-p)+p,\qquad \frac{\partial p}{\partial l}=\frac{\operatorname{diag}(p)-pp^\top}{\tau}.

stopgrad表示保留其值但不向参数传导梯度。对某一组,取拼接输出的上游敏感度中属于该组的向量uqu_q,选第vv项的敏感度是uq⊤evu_q^\top e_v;将这组分数与Jacobian相乘,就得到logit梯度。代码分别暴露soft和hard模式的向量—Jacobian乘积。有限差分可检验soft前向,不能据此认证直通替代量就是硬映射的真实导数。硬前向与软反向 固定量化器

对一个被遮位置,候选第0项是正例,后面的候选位置放负例。论文从同一句的其他被遮位置采样干扰项;本程序直接接收明确索引,重复索引仍在分母中重复计数。令JtJ_t为保留的候选位置,κ\kappa为对比温度:

Lcon=−1N∑t∈Mln⁡exp⁡(st0/κ)∑j∈Jtexp⁡(stj/κ),stj=ct⊤qtj∥ct∥∥qtj∥,N=∣M∣.\mathcal L_{\mathrm{con}}=-\frac1N\sum_{t\in M}\ln\frac{\exp(s_{t0}/\kappa)}{\sum_{j\in J_t}\exp(s_{tj}/\kappa)},\quad s_{tj}=\frac{c_t^\top q_{tj}}{\|c_t\|\|q_{tj}\|},\quad N=|M|.

量化温度τ\tau与比较温度κ\kappa负责不同环节。正例相对其他候选的分数越高,损失越低。固定模型会排除与正例向量逐项完全相同的负例,即使它来自另一帧;如果负例全被排除,正例概率为1、对比损失为0,却不能凭这一点断言表征有用。对比目标 相同向量过滤

用帽号表示单位向量,PtjP_{tj}表示候选softmax概率。余弦相似度的导数为(q^−sc^)/∥c∥(\widehat q-s\widehat c)/\|c\|,再乘softmax交叉熵的“概率减目标”因子:

∂Lcon∂ct=1Nκ∥ct∥∑j∈Jt(Ptj−1[j=0])(q^tj−stjc^t).\frac{\partial\mathcal L_{\mathrm{con}}}{\partial c_t}=\frac1{N\kappa\|c_t\|}\sum_{j\in J_t}(P_{tj}-\mathbf1[j=0])\bigl(\widehat q_{tj}-s_{tj}\widehat c_t\bigr).

目标向量的导数来自对称的余弦导数,并累计每一次候选出现。完全相等过滤是离散规则;这里的导数针对固定候选与过滤配置。有限差分使用互异、非零向量,不宣称在扰动改变过滤结果的地方仍然光滑。

对比任务也需要可用的目标。多样性统计先在帧维平均没有Gumbel噪声和温度的softmax,再计算每组熵。论文显示的负熵项与脚注中偏实现的perplexity项分别为:

pˉgv=1T∑tsoftmax⁡(ltg)v,Hg=−∑vpˉgvln⁡pˉgv,Lent=−∑gHgGV,Ldiv=1−∑gexp⁡(Hg)GV.\bar p_{gv}=\frac1T\sum_t\operatorname{softmax}(l_{tg})_v,\quad H_g=-\sum_v\bar p_{gv}\ln\bar p_{gv},\quad \mathcal L_{\mathrm{ent}}=-\frac{\sum_g H_g}{GV},\quad \mathcal L_{\mathrm{div}}=1-\frac{\sum_g\exp(H_g)}{GV}.

两者都偏好平均使用均匀,却是数值与梯度不同的函数。脚注的equivalent不能理解为逐点数值相等。实现中的sum-perplexity是∑gexp⁡(Hg)\sum_g\exp(H_g),上限为GVGV,不是可组合码字数量VGV^G。多样性公式与脚注 Perplexity惩罚

对perplexity形式,依次穿过帧平均和softmax求导得到:

agv=exp⁡(Hg)(ln⁡pˉgv+1)GVT,∂Ldiv∂ltgv=ptgv(0)(agv−∑jptgj(0)agj),ptg(0)=softmax⁡(ltg).a_{gv}=\frac{\exp(H_g)(\ln\bar p_{gv}+1)}{GVT},\qquad \frac{\partial\mathcal L_{\mathrm{div}}}{\partial l_{tgv}}=p^{(0)}_{tgv}\left(a_{gv}-\sum_jp^{(0)}_{tgj}a_{gj}\right),\quad p^{(0)}_{tg}=\operatorname{softmax}(l_{tg}).

与负熵形式相比,多出的exp⁡(Hg)\exp(H_g)还改变每组梯度的尺度。原训练目标以权重组合对比项和多样性项,另外的正则依配置而定。本例分别暴露两项,没有联合训练编码器、量化器与Transformer。

最后,时间步长与感受野是不同性质。对没有padding、卷积核kℓk_\ell、步长sℓs_\ell的一层,记录输出长度nn、输入采样间隔jj与感受野RR:

jℓ=jℓ−1sℓ,Rℓ=Rℓ−1+(kℓ−1)jℓ−1,nℓ=⌊nℓ−1−kℓsℓ⌋+1,j0=R0=1.j_\ell=j_{\ell-1}s_\ell,\quad R_\ell=R_{\ell-1}+(k_\ell-1)j_{\ell-1},\quad n_\ell=\left\lfloor\frac{n_{\ell-1}-k_\ell}{s_\ell}\right\rfloor+1,\quad j_0=R_0=1.

卷积核(10,3,3,3,3,2,2)、步长(5,2,2,2,2,2,2)最终给出320样本间隔、400样本感受野。16kHz下分别是20ms与25ms。有限16000样本输入得到49个有效帧,不能因此把名义步长改成1/49秒。卷积时间几何

先看清目标,再训练大网络

下面是完整Python/NumPy程序,接受有界实数数组、小型乘积码本与显式负例索引。量化最多16帧、3组、每组5项、每项4维;温度限制[0.05,5]。均匀噪声输入必须显式提供,省略它则确定性选择。教学目标的拼接后投影取恒等。

将程序保存为wav2vec2.py,使用Python 3.12和NumPy 1.26.4运行python wav2vec2.py。输入全部在本地生成,不需要GPU或下载模型。

"""Finite wav2vec 2.0 objectives, not a waveform encoder or speech recognizer."""
import json
import numpy as np


def array(values, ndim):
    raw = np.asarray(values)
    if raw.dtype.kind not in 'fiu' or raw.ndim != ndim:
        raise ValueError('Real numeric array with the declared rank required')
    x = raw.astype(float)
    if not np.isfinite(x).all() or np.max(np.abs(x), initial=0) > 20:
        raise ValueError('Finite values within +/-20 required')
    return x


def softmax(x):
    e = np.exp(x - np.max(x, axis=-1, keepdims=True))
    return e / e.sum(axis=-1, keepdims=True)


def temperature(value):
    if isinstance(value, (bool, np.bool_)) or not isinstance(value, (int, float, np.integer, np.floating)) or not .05 <= value <= 5:
        raise ValueError('Temperature must be in [0.05, 5]')
    return float(value)


def quantize(logits, books, tau=.5, uniforms=None, hard=True):
    l, e = array(logits, 3), array(books, 3)
    t, g, v = l.shape
    if not (1 <= t <= 16 and 1 <= g <= 3 and 2 <= v <= 5):
        raise ValueError('Quantizer bounds: 1..16 frames, 1..3 groups, 2..5 entries')
    if e.shape[:2] != (g, v) or not 1 <= e.shape[2] <= 4 or not isinstance(hard, bool):
        raise ValueError('Matching group/entry dimensions and Boolean hard mode required')
    tau = temperature(tau)
    noise = np.zeros_like(l)
    if uniforms is not None:
        u = array(uniforms, 3)
        if u.shape != l.shape or not ((u >= 1e-6) & (u <= 1-1e-6)).all():
            raise ValueError('Explicit uniforms must match logits and stay inside (0,1)')
        noise = -np.log(-np.log(u))
    p = softmax((l + noise) / tau)
    choices = np.argmax(l + noise, axis=-1)
    weights = np.eye(v)[choices] if hard else p
    features = np.einsum('tgv,gvd->tgd', weights, e).reshape(t, -1)
    return dict(features=features, probabilities=p, weights=weights,
                choices=choices, tau=tau, hard=hard)


def quantizer_vjp(logits, books, upstream, tau=.5, uniforms=None, hard=True):
    r = quantize(logits, books, tau, uniforms, hard)
    e = array(books, 3); u = array(upstream, 2)
    if u.shape != r['features'].shape:
        raise ValueError('Upstream derivative must match concatenated features')
    u = u.reshape(len(u), e.shape[0], e.shape[2])
    score = np.einsum('tgd,gvd->tgv', u, e)
    p = r['probabilities']
    dl = p * (score - (p * score).sum(axis=-1, keepdims=True)) / r['tau']
    de = np.einsum('tgv,tgd->gvd', r['weights'], u)
    # In hard mode dl is a straight-through surrogate, not the hard-map derivative.
    return dict(logits=dl, books=de)


def diversity(logits):
    l = array(logits, 3); t, g, v = l.shape
    if not (1 <= t <= 16 and 1 <= g <= 3 and 2 <= v <= 5):
        raise ValueError('Use the finite quantizer dimensions')
    p = softmax(l); mean = p.mean(axis=0)
    entropy = -(mean * np.log(mean)).sum(axis=-1)
    perplexity = np.exp(entropy)
    hard_mean = np.eye(v)[np.argmax(l, axis=-1)].mean(axis=0)
    positive = hard_mean > 0
    hard_terms = np.zeros_like(hard_mean)
    hard_terms[positive] = hard_mean[positive] * np.log(hard_mean[positive])
    slope = (np.log(mean) + 1) * perplexity[:, None] / (g*v*t)
    gradient = p * (slope - (p*slope).sum(axis=-1, keepdims=True))
    return dict(mean_probabilities=mean, entropy=entropy,
                probability_perplexity=float(perplexity.sum()),
                code_perplexity=float(np.exp(-hard_terms.sum(axis=-1)).sum()),
                negative_entropy=float(-entropy.sum()/(g*v)),
                loss=float(1-perplexity.sum()/(g*v)), gradient=gradient)


def contrastive(context, targets, negatives, kappa=.3):
    c, q = array(context, 2), array(targets, 2); ix = np.asarray(negatives)
    if c.shape != q.shape or not (2 <= len(c) <= 16 and 1 <= c.shape[1] <= 12):
        raise ValueError('Matched context/target arrays with 2..16 rows required')
    if ix.ndim != 2 or ix.dtype.kind not in 'iu' or ix.shape[0] != len(c) or not 1 <= ix.shape[1] <= 8:
        raise ValueError('Integer negative-index matrix with 1..8 candidates required')
    if not ((ix >= 0) & (ix < len(c))).all() or (ix == np.arange(len(c))[:, None]).any():
        raise ValueError('Negatives must index other supplied target rows')
    kappa = temperature(kappa)
    cn, qn = np.linalg.norm(c, axis=1), np.linalg.norm(q, axis=1)
    if (cn < 1e-8).any() or (qn < 1e-8).any():
        raise ValueError('Cosine inputs must have nonzero norms')
    ch, qh = c/cn[:, None], q/qn[:, None]
    dc, dq = np.zeros_like(c), np.zeros_like(q); losses=[]; probabilities=[]; discarded=[]
    for t in range(len(c)):
        candidates = np.r_[t, ix[t]]
        duplicate = np.r_[False, np.all(q[ix[t]] == q[t], axis=1)]
        cosine = qh[candidates] @ ch[t]
        score = cosine/kappa; score[duplicate] = -np.inf
        maximum = np.max(score); exp = np.exp(score-maximum); p = exp/exp.sum()
        losses.append(float(maximum + np.log(exp.sum()) - score[0]))
        probabilities.append(p); discarded.append(duplicate)
        weight = p.copy(); weight[0] -= 1; weight /= len(c)*kappa
        for j, index in enumerate(candidates):
            dc[t] += weight[j]*(qh[index]-cosine[j]*ch[t])/cn[t]
            dq[index] += weight[j]*(ch[t]-cosine[j]*qh[index])/qn[index]
    return dict(loss=float(np.mean(losses)), per_frame=losses,
                probabilities=np.array(probabilities), discarded=np.array(discarded),
                context_gradient=dc, target_gradient=dq)


def span_mask(length, starts, span):
    if type(length) is not int or not 1 <= length <= 32 or type(span) is not int or not 1 <= span <= length:
        raise ValueError('Positive finite integer length/span required')
    if not isinstance(starts, (list, tuple)) or any(type(i) is not int for i in starts) or len(set(starts)) != len(starts):
        raise ValueError('Unique integer starts required')
    if any(i < 0 or i+span > length for i in starts):
        raise ValueError('Every full span must fit')
    mask = np.zeros(length, bool)
    for i in starts: mask[i:i+span] = True
    return mask


def geometry(samples):
    if type(samples) is not int or not 400 <= samples <= 1_000_000:
        raise ValueError('At least one full receptive field is required')
    length, jump, field = samples, 1, 1
    for kernel, stride in zip((10,3,3,3,3,2,2), (5,2,2,2,2,2,2)):
        length = (length-kernel)//stride+1
        field += (kernel-1)*jump; jump *= stride
    return dict(frames=length, stride_samples=jump, receptive_field_samples=field)


def clean(x):
    if isinstance(x, np.ndarray): return x.tolist()
    if isinstance(x, dict): return {k:clean(v) for k,v in x.items()}
    if isinstance(x, (list, tuple)): return [clean(v) for v in x]
    if isinstance(x, np.generic): return x.item()
    return x


def demo():
    logits = np.array([[[3,0,-1],[0,3,-1]],[[0,3,-1],[3,0,-1]],
                       [[-1,0,3],[0,3,-1]],[[3,0,-1],[-1,0,3]]], float)
    books = np.array([[[1,0],[0,1],[-1,0]],[[0,1],[1,0],[0,-1]]], float)
    quantized = quantize(logits, books)
    q = quantized['features']; context = .3*q + .7*np.roll(q,1,axis=0) + .1
    negatives = np.array([[j for j in range(4) if j != i] for i in range(4)])
    initial = contrastive(context,q,negatives); losses=[]; trained=context.copy()
    for step in range(7):
        result=contrastive(trained,q,negatives);losses.append(result['loss'])
        if step<6:trained -= .2*result['context_gradient']
    uniform=np.zeros((4,2,3));collapsed=np.tile([[[8,-8,-8],[8,-8,-8]]],(4,1,1))
    duplicate=contrastive([[1,.2],[.2,1]],[[1,0],[1,0]],[[1],[0]])
    return clean(dict(logits=logits,books=books,quantized=quantized,context=context,
        negatives=negatives,initial=initial,training_losses=losses,diversity=diversity(logits),
        uniform_diversity=diversity(uniform),collapsed_diversity=diversity(collapsed),
        duplicate_example=duplicate,mask=span_mask(12,[2,4],4),geometry=geometry(16000)))


if __name__ == '__main__':
    print(json.dumps(demo(), ensure_ascii=False, indent=2, allow_nan=False))

四个context是由合成目标混合构造的供给向量,不是遮盖声学编码器输出。固定targets,六步只更新context,把对比目标从约2.076875降到0.464356。独立diversity函数的解析梯度由中心差分核对;代码没有把它接成一个声称完整模型训练的循环。

2组、每组3项时,均匀logits给出约6的概率perplexity,但无噪声argmax平分时总取首项,code perplexity为2。带Gumbel训练又会产生另一种选择分布。反过来,各帧确信不同类别而总体均衡时,平均分布的熵可以很高,逐帧熵却很低。固定量化器分别记录这些诊断;本例按数学0ln⁡0=00\ln0=0定义,不加它的小epsilon。不同的码本诊断

共有TT帧、每项维度dd时,量化时间为O(TGVd)O(TGVd),概率、输出和码本占O(TGV+TGd+GVd)O(TGV+TGd+GVd)空间。对于NN个选定位置、每行KK个负例候选位置和比较维度DD,本供给向量例子的对比得分及两个梯度耗时O(N(K+1)D)O(N(K+1)D),空间为O(N(K+1)+ND)O(N(K+1)+ND)。多样性时间为O(TGV)O(TGV)。这些范围是小组件,不是Transformer预训练成本。零范数余弦输入明确拒绝,没有暗中采用某个库的epsilon分段定义。

预训练目标不等于部署成绩

原论文在ASR阶段增加有监督输出投影,再用CTC微调。使用无标签音频预训练,并没有消除所有转写、解码选择与评价参考的需要。比较系统时应分开无标签数据量、有标签微调量及外部语言模型提供的信息;只按预训练loss选表征,并不是在测试转写质量。

数据域同样重要。Robust wav2vec 2.0研究明确区分预训练、微调与测试域,结论适用于其检查过的配置,不能扩展成任意域不变性的保证。本篇用这种区分提出评测问题,不复现或直接采用其榜单数字。域偏移研究

此实现省略波形特征学习、自注意力、联合码本训练、完整随机mask和下游识别,目的是让候选计数、硬/软梯度与码本统计可以检查。它不能证明声学模型的准确率、训练成本或延迟。

先预测变化,再计算

  1. 基本理解。 量化目标应该接收与context输入相同的遮盖吗?

    答案:原方法量化未遮盖特征。如果连该支路也破坏,就会改变或删掉定义目标的信息;context破坏与目标构造的作用不同。

  2. 手算。 两个单位向量互相正交,各context都匹配自身正例;比较温度为1时,一个负例给出什么loss?负例重复列两次呢?

    答案:正例与负例余弦分别1和0,因此为ln⁡(1+e−1)\ln(1+e^{-1})与ln⁡(1+2e−1)\ln(1+2e^{-1}),约0.313262与0.551445。重复候选位置保留其重数。

  3. 边界。 两组各有三个等概率项,确定性argmax就一定输出全部九种组合吗?

    答案:不会。sum-perplexity可以为6,平分时每组却一直选首项,确定性code perplexity为2。九是索引组合数上限,不是两个诊断量,也不是使用保证;带噪训练选择又是另一个量。

  4. 迁移。 硬量化的有限差分导数为0,直通logit梯度却非零,一定是实现错误吗?

    答案:不是。远离边界时硬前向局部常数;直通有意用soft Jacobian替代。应将soft前向与有限差分比较,并说明替代量的含义,不能宣称两种导数相同。

区分公式、配置与实验

NeurIPS2020论文给出双支路结构及原始目标,固定fairseq量化器/模型与PyTorch2.6源码澄清温度、诊断和过滤;域偏移论文提出另一层评价问题。本篇数值只来自上述供给数组和完整程序,没有复现完整模型训练、论文WER表或迁移成绩。

先判断,再看解释

概率perplexity达到最大,能保证无噪声argmax选择多样吗?

选择一个答案

学习目标

  • 区分遮盖上下文与未遮盖的量化目标。
  • 区分软导数、硬选择和直通梯度。
  • 在明确边界条件下计算对比与多样性损失。
  • 解释perplexity与卷积时间几何,不据此推断识别质量。

先修与延伸

查看知识关联图 →

参考文献

  1. wav2vec 2.0: A Framework for Self-Supervised Learning of Speech
    Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, Michael Auli · 2020
  2. fairseq: grouped Gumbel vector quantizer at 3d262bb
    fairseq contributors
  3. fairseq: wav2vec 2.0 contrastive scoring at 3d262bb
    fairseq contributors
  4. PyTorch 2.6 functional source: gumbel_softmax
    PyTorch contributors
  5. Robust wav2vec 2.0: Analyzing Domain Shift in Self-Supervised Pre-Training
    Wei-Ning Hsu, Anuroop Sriram, Alexei Baevski, Tatiana Likhomanenko, Qiantong Xu, Vineel Pratap, Jacob Kahn, Ann Lee, Ronan Collobert, Gabriel Synnaeve, Michael Auli · 2021

版本1 · 编写状态: 已完成记录中的技术复核

查看技术检查记录(AI)

Codex · 2026-09-13 · Single AI author checked the 2020 wav2vec2 two-path architecture, positive-temperature Gumbel definition, hard-forward versus straight-through derivative, masked contrastive candidates and equal-vector filtering, cosine gradients, negative entropy versus perplexity, noiseless diagnostics and finite convolution geometry against scoped NeurIPS2020 pages3–4, fixed fairseq ranges and PyTorch2.6 gumbel source. Eight paired equations and four explained exercises. Supplied context/target component computations only, not encoder/quantizer joint training, recognition benchmarks or domain-invariance proof.

  • 分别检查soft有限差分与hard替代量、重复负例log(1+exp(-1))和log(1+2exp(-1))、完全相等过滤、多样性梯度及概率perplexity6与无噪声code2;重叠遮盖6帧与320/400/49几何。仅context更新loss从2.076875降至0.464356。
  • 四张计算SVG绑定真实双语程序;本组九项数值/编码检查、12组语言/宽度及四字体检查通过,AI作者实际查看八张截图。冻结前检查普通正文AST;完整文章页面验收另记,不称人工同行审校。

核对的来源位置:

  • wav2vec 2.0: A Framework for Self-Supervised Learning of Speech · Read sections2–3 architecture, masking, quantization, objectives and CTC; sections4.1–4.2 data/configuration fragments. Visually inspected physical pages3–4 equations and footnote2. Temperature typography and entropy/perplexity differences are stated; no benchmark reproduced. Author spelling follows the read PDF.
  • fairseq: grouped Gumbel vector quantizer at 3d262bb · Read lines91–95 and147–205: temperature schedule, noiseless diagnostics, soft probability perplexity, Gumbel selection and group concatenation. Full MIT license read; no upstream code executed or copied. Original example omits the entropy epsilon.
  • fairseq: wav2vec 2.0 contrastive scoring at 3d262bb · Read negative-index sampling fragment499–525, cosine/equal-negative filter557–577 and target/extra-loss814–837. Not an audit of the complete forward path or every loss configuration.
  • PyTorch 2.6 functional source: gumbel_softmax · Read complete gumbel_softmax function and documentation in extracted lines1977–2040: divide logits plus noise by tau, and hard-minus-detached-soft plus soft. PyTorch not executed.
  • Robust wav2vec 2.0: Analyzing Domain Shift in Self-Supervised Pre-Training · Read abstract, opening introduction and conclusion only; used for separating pretraining, fine-tuning and test domains. No numeric improvement claims or tables adopted. Sidebar April2 and internal October12,2021 dates conflict; not resolved into a publication history.

相关主题

没有匹配结果,试试英文名或缩写。

已显示 0 条结果

将整个查询放入双引号,可按短语匹配。