{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"预处理和两条编码支路到底做了什么？","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html","markdown":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.md","pages":[{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","unit":"预处理和两条编码支路到底做了什么？","unitId":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","chapter":"course","number":1}],"aliases":[{"oldId":"b-444c8d607f0289e311f5ab14","targetId":"b-444c8d607f0289e311f5ab14","page":"reading-opening","operation":"move","beforeSHA256":"b097cc692a4f43c3eeba08ce9c2e73c631f1bad298a5fb1dec9efa967315dac3","afterSHA256":"b097cc692a4f43c3eeba08ce9c2e73c631f1bad298a5fb1dec9efa967315dac3","reason":"Same source body in authored semantic page"},{"oldId":"b-26dabc97db1394141c5d99d3","targetId":"b-26dabc97db1394141c5d99d3","page":"reading-opening","operation":"move","beforeSHA256":"39b61bfbeb0ab0f303e0e2595964d00760d2f6e834822ca165e37efedfcdc4a6","afterSHA256":"39b61bfbeb0ab0f303e0e2595964d00760d2f6e834822ca165e37efedfcdc4a6","reason":"Same source body in authored semantic page"},{"oldId":"b-f4137b2cf25e30c52b1c9394","targetId":"b-f4137b2cf25e30c52b1c9394","page":"reading-opening","operation":"move","beforeSHA256":"42cba31deccba2a350b9b23bd0ca1dcaa4c4c5cb9d35c773e1fcb89124788ccd","afterSHA256":"42cba31deccba2a350b9b23bd0ca1dcaa4c4c5cb9d35c773e1fcb89124788ccd","reason":"Same source body in authored semantic page"},{"oldId":"b-8134c0de75318e321e3e80c6","targetId":"b-8134c0de75318e321e3e80c6","page":"reading-opening","operation":"move","beforeSHA256":"90e8ba62b9af4bedd5be3a2559568519f4df7a42b13048f81039496efd45dea2","afterSHA256":"90e8ba62b9af4bedd5be3a2559568519f4df7a42b13048f81039496efd45dea2","reason":"Same source body in authored semantic page"},{"oldId":"b-693000981b364b22689c1c86","targetId":"b-693000981b364b22689c1c86","page":"reading-opening","operation":"move","beforeSHA256":"4227d215a5365c216c591d138650d0074d422406d52d369b938da2510c55ecb8","afterSHA256":"4227d215a5365c216c591d138650d0074d422406d52d369b938da2510c55ecb8","reason":"Same source body in authored semantic page"},{"oldId":"b-c6e1b9aad7b65cac1d477eb7","targetId":"b-c6e1b9aad7b65cac1d477eb7","page":"reading-opening","operation":"move","beforeSHA256":"551b29c91d6c2e964eb6f0864175d1a3cae486550e57203367929de82204e36d","afterSHA256":"551b29c91d6c2e964eb6f0864175d1a3cae486550e57203367929de82204e36d","reason":"Same source body in authored semantic page"},{"oldId":"b-024909ddac0790cadcdf19fa","targetId":"b-024909ddac0790cadcdf19fa","page":"reading-opening","operation":"move","beforeSHA256":"59d972b7a7945ded7b62c614dc541e82d259c17a4b3cd968a54d03da8a101b7f","afterSHA256":"59d972b7a7945ded7b62c614dc541e82d259c17a4b3cd968a54d03da8a101b7f","reason":"Same source body in authored semantic page"},{"oldId":"b-d219c42f4f77ef0f2bc11d6c","targetId":"b-d219c42f4f77ef0f2bc11d6c","page":"reading-opening","operation":"move","beforeSHA256":"99beb2d6a5d9904ce69adb41cd2bf80d59594073ae2fbc7002054d338eb7ed7a","afterSHA256":"99beb2d6a5d9904ce69adb41cd2bf80d59594073ae2fbc7002054d338eb7ed7a","reason":"Same source body in authored semantic page"},{"oldId":"block-e8d09daa81304bbebf6af1b6be1d73f0--预处理和两条编码支路到底做了什么","targetId":"b-693000981b364b22689c1c86","operation":"retain-source-identity"}],"blocks":[{"id":"b-444c8d607f0289e311f5ab14","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-444c8d607f0289e311f5ab14","content":"[LAB 04 · CLIP：候选、提示与关系检验](/course/notebooks/0ba963931ddf4866b507b210d93a43bf.html)","sha256":"b097cc692a4f43c3eeba08ce9c2e73c631f1bad298a5fb1dec9efa967315dac3","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-26dabc97db1394141c5d99d3","prerequisites":[],"relatedBlocks":[]},{"id":"b-26dabc97db1394141c5d99d3","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-26dabc97db1394141c5d99d3","content":"# 预处理和两条编码支路到底做了什么？","sha256":"39b61bfbeb0ab0f303e0e2595964d00760d2f6e834822ca165e37efedfcdc4a6","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-444c8d607f0289e311f5ab14","nextBlock":"b-f4137b2cf25e30c52b1c9394","prerequisites":[{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-f4137b2cf25e30c52b1c9394","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-f4137b2cf25e30c52b1c9394","content":"主线阅读与优先实验","sha256":"42cba31deccba2a350b9b23bd0ca1dcaa4c4c5cb9d35c773e1fcb89124788ccd","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-26dabc97db1394141c5d99d3","nextBlock":"b-8134c0de75318e321e3e80c6","prerequisites":[{"id":"b-26dabc97db1394141c5d99d3","url":"#b-26dabc97db1394141c5d99d3","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-8134c0de75318e321e3e80c6","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-8134c0de75318e321e3e80c6","content":"真实CLIP输入/权重/分数、候选改动、四条件规则与独立关系推理","sha256":"90e8ba62b9af4bedd5be3a2559568519f4df7a42b13048f81039496efd45dea2","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-f4137b2cf25e30c52b1c9394","nextBlock":"b-693000981b364b22689c1c86","prerequisites":[{"id":"b-26dabc97db1394141c5d99d3","url":"#b-26dabc97db1394141c5d99d3","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-693000981b364b22689c1c86","type":"h3","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-693000981b364b22689c1c86","content":"### 预处理和两条编码支路到底做了什么？","sha256":"4227d215a5365c216c591d138650d0074d422406d52d369b938da2510c55ecb8","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-8134c0de75318e321e3e80c6","nextBlock":"b-c6e1b9aad7b65cac1d477eb7","prerequisites":[{"id":"b-26dabc97db1394141c5d99d3","url":"#b-26dabc97db1394141c5d99d3","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-c6e1b9aad7b65cac1d477eb7","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-c6e1b9aad7b65cac1d477eb7","content":"图像先转 RGB，以 bicubic 将短边缩放至 224，再中心裁剪为 224×224，使用 checkpoint 指定的均值和标准差归一化。文本用固定 `CLIPTokenizerFast` 产生 token IDs、起止标记和 padding；本例短句没有超过 77-token 上限。图像批次是 `[B,3,224,224]`，文字批次是 `[Q,L]`，两个编码器的输出均投影为 512 维。它们随后分别除以 L2 范数；这一步之后点积才等于 cosine。","sha256":"551b29c91d6c2e964eb6f0864175d1a3cae486550e57203367929de82204e36d","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-693000981b364b22689c1c86","nextBlock":"b-024909ddac0790cadcdf19fa","prerequisites":[{"id":"b-693000981b364b22689c1c86","url":"#b-693000981b364b22689c1c86","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-024909ddac0790cadcdf19fa","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-024909ddac0790cadcdf19fa","content":"设图像、文字特征为 $v_i,t_j$，归一化后的分数为 $s_{ij}=v_i^\\top t_j$。候选内分布 $p(j|i,\\mathcal C)=\\exp(\\alpha s_{ij})/\\sum_{k\\in\\mathcal C}\\exp(\\alpha s_{ik})$ 还需要固定模型的 $\\alpha$，本 checkpoint 为约 100。A→B 改变分母，A→C 改变 token 和文本特征；B→D 删除了正确答案。三种干预不能混为“模型概率变了”。","sha256":"59d972b7a7945ded7b62c614dc541e82d259c17a4b3cd968a54d03da8a101b7f","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[{"latex":"v_i,t_j","definitionContext":"预处理和两条编码支路到底做了什么？"},{"latex":"s_{ij}=v_i^\\top t_j","definitionContext":"预处理和两条编码支路到底做了什么？"},{"latex":"p(j|i,\\mathcal C)=\\exp(\\alpha s_{ij})/\\sum_{k\\in\\mathcal C}\\exp(\\alpha s_{ik})","definitionContext":"预处理和两条编码支路到底做了什么？"},{"latex":"\\alpha","definitionContext":"预处理和两条编码支路到底做了什么？"}],"previousBlock":"b-c6e1b9aad7b65cac1d477eb7","nextBlock":"b-d219c42f4f77ef0f2bc11d6c","prerequisites":[{"id":"b-693000981b364b22689c1c86","url":"#b-693000981b364b22689c1c86","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-d219c42f4f77ef0f2bc11d6c","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0.html#b-d219c42f4f77ef0f2bc11d6c","content":"候选 softmax 既没有估计候选之外的类别，也没有做概率校准。D 的 tiger 为 0.7174，只说明它在删去 cat 后的四个选项里分数最高；不能推出照片有 71.74% 的概率是一只老虎。图搜文是固定图片对多条文字排序，文搜图是固定文字对多张图片排序；两个方向使用同一相似度矩阵的不同维度，都不生成一个新句子。caption 需要逐词条件分布和解码器，详见 LAB 13。","sha256":"99beb2d6a5d9904ce69adb41cd2bf80d59594073ae2fbc7002054d338eb7ed7a","chapter":{"id":"course","title":"预处理和两条编码支路到底做了什么？"},"unit":{"id":"notebook-blocks/e8d09daa81304bbebf6af1b6be1d73f0","title":"预处理和两条编码支路到底做了什么？"},"page":{"id":"reading-opening","title":"预处理和两条编码支路到底做了什么？","number":1},"sectionTitle":"预处理和两条编码支路到底做了什么？","currentQuestion":"预处理和两条编码支路到底做了什么？","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-024909ddac0790cadcdf19fa","nextBlock":null,"prerequisites":[{"id":"b-693000981b364b22689c1c86","url":"#b-693000981b364b22689c1c86","role":"section-title"},{"id":"b-444c8d607f0289e311f5ab14","url":"#b-444c8d607f0289e311f5ab14","role":"problem-context"}],"relatedBlocks":[]}]}
