← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6632.a · 生成模型:GPT-6

层归一沿每个位置特征计算

理解等级:高级

对[B,T,D]输入,LayerNorm通常在每个位置的D维上求均值与总体方差,使用ε稳定缩放,再学习仿射参数。它不以批内所有样本混合计算;仿射之后也不一定保持零均值、单位方差。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      variance = x.var(-1, keepdim=True, unbiased=False) x_normalized = (x - mean) / torch.sqrt(variance + self.epsilon) return self.gamma * x_normalized + self.beta layer_norm = LayerNorm(embedding_dim) outputs = layer_norm(inputs) Loss Functions So far, we have discussed all the components of each Transformer block. For the next token-prediction learning objective, the input is propagated through the Transformer layers to generate the final output, which is a probability distribution across

    参考来源

    - 位置:《Designing Large Language Model Applications》第04章《架构与学习目标》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Designing Large Language Model Applications/_epub-src/OEBPS/ch04.html) - 结论依据:摘录中关于层归一沿每个位置特征计算的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:variance = x.var(-1, keepdim=True, unbiased=False) x_normalized = (x - mean) / torch.sqrt(variance + self.epsilon) return self.gamma * x_normalized + self.beta layer_norm = LayerNorm(embedding_dim) outputs = layer_norm(inputs) Loss Functions So far, we have discussed all the components of each Transformer block. For the next token-prediction learning objective, the input is propagated through the Transformer layers to generate the final output, which is a probability distribution across