{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"把一次学习走通，也读清实现顺序","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html","markdown":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.md","pages":[{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","unit":"怎样增加候选，同时让历史表示仍可比较？","unitId":"i-dictionary-and-updates","chapter":"I","number":1}],"aliases":[{"oldId":"b-c121d95c55eaa328c82d44cb","targetId":"b-c121d95c55eaa328c82d44cb","page":"reading-opening","operation":"move","beforeSHA256":"ef2145eeed51e5613f92f3ee908c0321f21641132ad2a51cb5981b42fdc5d732","afterSHA256":"ef2145eeed51e5613f92f3ee908c0321f21641132ad2a51cb5981b42fdc5d732","reason":"Same source body in authored semantic page"},{"oldId":"b-14773f29ca71dcdf8731004d","targetId":"b-14773f29ca71dcdf8731004d","page":"reading-opening","operation":"move","beforeSHA256":"32e3dfb57a0c0ee8ebfaa6dba8b4550a4d63de60d198ddcb5319190026ceea8c","afterSHA256":"32e3dfb57a0c0ee8ebfaa6dba8b4550a4d63de60d198ddcb5319190026ceea8c","reason":"Same source body in authored semantic page"},{"oldId":"b-df4270d2572e837463aaec44","targetId":"b-df4270d2572e837463aaec44","page":"reading-opening","operation":"move","beforeSHA256":"4b3c3586979f78ca4986198828909eb0d7cfd735da40c74a52c00cfdce532130","afterSHA256":"4b3c3586979f78ca4986198828909eb0d7cfd735da40c74a52c00cfdce532130","reason":"Same source body in authored semantic page"},{"oldId":"b-db4685c198763e878d317b6c","targetId":"b-db4685c198763e878d317b6c","page":"reading-opening","operation":"move","beforeSHA256":"8c189b3e064e75cf8a9b68c96e6804f3a774061b77b895462a26431cb0a3a9dd","afterSHA256":"8c189b3e064e75cf8a9b68c96e6804f3a774061b77b895462a26431cb0a3a9dd","reason":"Same source body in authored semantic page"},{"oldId":"b-370abb17029f734a5ace74a9","targetId":"b-370abb17029f734a5ace74a9","page":"reading-opening","operation":"move","beforeSHA256":"9afe8ea0540ab018647cf0d557e40ffbe3a252b27be86ee5cf1cf36f008fcf6d","afterSHA256":"9afe8ea0540ab018647cf0d557e40ffbe3a252b27be86ee5cf1cf36f008fcf6d","reason":"Same source body in authored semantic page"},{"oldId":"b-ae8ec28a1cd7dd8510a3db3c","targetId":"b-ae8ec28a1cd7dd8510a3db3c","page":"reading-opening","operation":"rewrite","beforeSHA256":"a94d21a647117520cdda0073b788afb5332bda8c7d36ed8b291fc4cc84fadd1d","afterSHA256":"ffbc4893c3bc7ad98c47bdaedcd0f0836bf54bd7a2e07cd3256dae5a7c33b207","reason":"Same source identity with figure semantics or reading context enriched"},{"oldId":"b-4d393fa2b639c8af19aa1462","targetId":"b-4d393fa2b639c8af19aa1462","page":"reading-opening","operation":"move","beforeSHA256":"2b9ccef7e1220e2250cceff1abd8bdd736b42f8da5a223f26b029f44b962e807","afterSHA256":"2b9ccef7e1220e2250cceff1abd8bdd736b42f8da5a223f26b029f44b962e807","reason":"Same source body in authored semantic page"}],"blocks":[{"id":"b-c121d95c55eaa328c82d44cb","type":"h1","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-c121d95c55eaa328c82d44cb","content":"# 把一次学习走通，也读清实现顺序","sha256":"ef2145eeed51e5613f92f3ee908c0321f21641132ad2a51cb5981b42fdc5d732","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-14773f29ca71dcdf8731004d","prerequisites":[{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]},{"id":"b-14773f29ca71dcdf8731004d","type":"p","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-14773f29ca71dcdf8731004d","content":"本页把前两页对象放回一条可追踪过程。纸面步骤与Notebook时序有细微差异，说明已明确标注。","sha256":"32e3dfb57a0c0ee8ebfaa6dba8b4550a4d63de60d198ddcb5319190026ceea8c","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-c121d95c55eaa328c82d44cb","nextBlock":"b-df4270d2572e837463aaec44","prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]},{"id":"b-df4270d2572e837463aaec44","type":"p","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-df4270d2572e837463aaec44","content":"沿当前图逐项走：本批原图产生两视图；query/key编码器分别给出q、k⁺；q与k⁺及旧队列比较；loss更新query；key按EMA跟随；本次已经算出的k⁺入队、最老key出队。旧队列不因本步更新重算。","sha256":"4b3c3586979f78ca4986198828909eb0d7cfd735da40c74a52c00cfdce532130","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-14773f29ca71dcdf8731004d","nextBlock":"b-db4685c198763e878d317b6c","prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"},{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]},{"id":"b-db4685c198763e878d317b6c","type":"p","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-db4685c198763e878d317b6c","content":"主讲画面按原论文Algorithm 1排列。当前LAB 07教学代码则在计算本批key之前执行EMA，再计算loss和query更新。这是训练步内的时序约定差异，读代码时必须跟着实际顺序，不要声称逐行相同。两者共享的关键机制是：query接受梯度、key停止梯度并平滑跟随、队列复用历史特征。","sha256":"8c189b3e064e75cf8a9b68c96e6804f3a774061b77b895462a26431cb0a3a9dd","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-df4270d2572e837463aaec44","nextBlock":"b-370abb17029f734a5ace74a9","prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"},{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]},{"id":"b-370abb17029f734a5ace74a9","type":"p","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-370abb17029f734a5ace74a9","content":"LAB 07另外在队列保存源图ID，屏蔽同源旧key，避免同一图片再次出现时成为自己的负例；不同源图仍可能属于同一类别。它没有论文的分布式ShuffleBN，训练15轮的效果也不用于论文排名。学生完成本节后，应能指出一条key何时生成、何时用于比较、何时离开。","sha256":"9afe8ea0540ab018647cf0d557e40ffbe3a252b27be86ee5cf1cf36f008fcf6d","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-db4685c198763e878d317b6c","nextBlock":"b-ae8ec28a1cd7dd8510a3db3c","prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"},{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]},{"id":"b-ae8ec28a1cd7dd8510a3db3c","type":"figure","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-ae8ec28a1cd7dd8510a3db3c","content":"图内标签与数值：P17 学习表示机制图，状态 3；同一输入；视图 a；视图 b；query 编码器；key 编码器；q；k⁺ = k₅；L = −ln p⁺；比较用旧字典；k₁ … k₄；q 与所有候选比较；k⁺ 是本轮正确项；梯度 → θq；EMA；k₅ 入队；k₁ 退队；k₂ k₃ k₄ k₅；下一批的字典；按原文算法 1：更新 query，再平均 key 参数并维护下一批的字典。\n\nquery、正例、旧队列、两次参数更新与FIFO是同一步的不同对象。 查看对应图解状态\n\n- 同一输入\n- 视图 a\n- 视图 b\n- query 编码器\n- key 编码器\n- q\n- k⁺ = k₅\n- L = −ln p⁺\n- 比较用旧字典\n- k₁ … k₄\n- q 与所有候选比较\n- k⁺ 是本轮正确项\n- 梯度 → θq\n- EMA\n- k₅ 入队；k₁ 退队\n- k₂ k₃ k₄ k₅\n- 下一批的字典\n- 按原文算法 1：更新 query，再平均 key 参数并维护下一批的字典。query、正例、旧队列、两次参数更新与FIFO是同一步的不同对象。 [查看对应图解状态](/#/l3-r2-p17/2)[查看完整图解](/#/l3-r2-p17/2)","sha256":"ffbc4893c3bc7ad98c47bdaedcd0f0836bf54bd7a2e07cd3256dae5a7c33b207","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"figure":{"caption":"query、正例、旧队列、两次参数更新与FIFO是同一步的不同对象。 查看对应图解状态","labels":["同一输入","视图 a","视图 b","query 编码器","key 编码器","q","k⁺ = k₅","L = −ln p⁺","比较用旧字典","k₁ … k₄","q 与所有候选比较","k⁺ 是本轮正确项","梯度 → θq","EMA","k₅ 入队；k₁ 退队","k₂ k₃ k₄ k₅","下一批的字典","按原文算法 1：更新 query，再平均 key 参数并维护下一批的字典。"],"description":"query、正例、旧队列、两次参数更新与FIFO是同一步的不同对象。 查看对应图解状态同一输入视图 a视图 bquery 编码器key 编码器qk⁺ = k₅L = −ln p⁺比较用旧字典k₁ … k₄q 与所有候选比较k⁺ 是本轮正确项梯度 → θqEMAk₅ 入队；k₁ 退队k₂ k₃ k₄ k₅下一批的字典按原文算法 1：更新 query，再平均 key 参数并维护下一批的字典。","evidenceIdentity":"query、正例、旧队列、两次参数更新与FIFO是同一步的不同对象。 查看对应图解状态","images":[{"src":"/assets/display/9a66faeae8dd2c354bc56482.webp","alt":""}]},"previousBlock":"b-370abb17029f734a5ace74a9","nextBlock":"b-4d393fa2b639c8af19aa1462","prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"},{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-4d393fa2b639c8af19aa1462","type":"h2","scope":"moco-one-step-paper-and-code","url":"https://codingai-lec03.pages.dev/course/blocks/moco-one-step-paper-and-code.html#b-4d393fa2b639c8af19aa1462","content":"## 继续阅读与实验","sha256":"2b9ccef7e1220e2250cceff1abd8bdd736b42f8da5a223f26b029f44b962e807","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-dictionary-and-updates","title":"怎样增加候选，同时让历史表示仍可比较？"},"page":{"id":"reading-opening","title":"把一次学习走通，也读清实现顺序","number":1},"sectionTitle":"把一次学习走通，也读清实现顺序","currentQuestion":"把一次学习走通，也读清实现顺序","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-ae8ec28a1cd7dd8510a3db3c","nextBlock":null,"prerequisites":[{"id":"b-c121d95c55eaa328c82d44cb","url":"#b-c121d95c55eaa328c82d44cb","role":"section-title"},{"id":"b-14773f29ca71dcdf8731004d","url":"#b-14773f29ca71dcdf8731004d","role":"problem-context"}],"relatedBlocks":[{"id":"b-ae8ec28a1cd7dd8510a3db3c","url":"#b-ae8ec28a1cd7dd8510a3db3c","relation":"figure-and-explanation"}]}]}
