修正: deepseek 笔记 96 处块级公式改为多行写法(适配 SilverBullet 行首锚点), 索引脚本同步 _abstract 命名
This commit is contained in:
@@ -40,7 +40,9 @@ DeepSeek-OCR 2 沿用 DeepSeek-OCR 的「编码器 + 解码器」架构,关键
|
||||
|
||||
掩码由两个区域沿序列维度拼接:左侧对原始视觉词元施加双向注意力(类似 ViT),任意词元互相可见;右侧对因果流词元施加因果注意力(三角掩码,与仅解码器 LLM 一致),每个词元只关注之前的词元。形式为
|
||||
|
||||
$$M=\begin{bmatrix}\mathbf{1}_{m\times m}&\mathbf{0}_{m\times n}\\ \mathbf{1}_{n\times m}&\text{LowerTri}(n)\end{bmatrix},\quad\text{其中 }n=m$$
|
||||
$$
|
||||
M=\begin{bmatrix}\mathbf{1}_{m\times m}&\mathbf{0}_{m\times n}\\ \mathbf{1}_{n\times m}&\text{LowerTri}(n)\end{bmatrix},\quad\text{其中 }n=m
|
||||
$$
|
||||
|
||||
其中 $n$ 为因果查询词元数,$m$ 为朴素视觉词元数,$\text{LowerTri}$ 为下三角矩阵。
|
||||
|
||||
@@ -48,7 +50,9 @@ $$M=\begin{bmatrix}\mathbf{1}_{m\times m}&\mathbf{0}_{m\times n}\\ \mathbf{1}_{n
|
||||
|
||||
解码器不做升级,沿用 DeepSeek-OCR 的 3B 参数 MoE 结构(约 500M 激活参数)。核心前向过程为
|
||||
|
||||
$$\mathbf{O}=\mathcal{D}\left(\pi_{Q}\left(\mathcal{T}^{L}\left(\mathcal{E}(\mathbf{I})\oplus\mathbf{Q}_{0};\mathbf{M}\right)\right)\right)$$
|
||||
$$
|
||||
\mathbf{O}=\mathcal{D}\left(\pi_{Q}\left(\mathcal{T}^{L}\left(\mathcal{E}(\mathbf{I})\oplus\mathbf{Q}_{0};\mathbf{M}\right)\right)\right)
|
||||
$$
|
||||
|
||||
其中 $\mathcal{E}$ 为视觉分词器(图像→$m$ 个视觉词元),$\mathbf{Q}_{0}$ 为可学习因果查询嵌入,$\oplus$ 为序列拼接,$\mathcal{T}^{L}$ 是带掩码注意力的 $L$ 层 Transformer,$\mathbf{M}$ 为式 (1) 的块状因果掩码,$\pi_{Q}$ 抽取最后 $n$ 个词元,$\mathcal{D}$ 为语言解码器,$\mathbf{O}$ 为词表上的输出 logits。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user