{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"一次对比，就是一次有答案的选择","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html","markdown":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.md","pages":[{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","unit":"视图关系怎样成为学习目标，又会牺牲什么？","unitId":"i-view-objective","chapter":"I","number":1},{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","unit":"视图关系怎样成为学习目标，又会牺牲什么？","unitId":"i-view-objective","chapter":"I","number":2}],"aliases":[{"oldId":"explanation","targetId":"h-i-contrastive-choice","operation":"split-explanation-range"},{"oldId":"b-0062a66b159b8321641a31bc","targetId":"b-0062a66b159b8321641a31bc","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"d71cf15e707c8a3674b4c90a599efee783cb84da5b8c8236a1d01c3add7b4958","afterSHA256":"d71cf15e707c8a3674b4c90a599efee783cb84da5b8c8236a1d01c3add7b4958","reason":"Same source body in authored semantic page"},{"oldId":"b-901ef17381bd7e373e02cf5c","targetId":"b-901ef17381bd7e373e02cf5c","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"816b88c5ec645a7b3c65198c0878e5cfafcf53fc0dbb4e57668de2c4950697d1","afterSHA256":"816b88c5ec645a7b3c65198c0878e5cfafcf53fc0dbb4e57668de2c4950697d1","reason":"Same source body in authored semantic page"},{"oldId":"b-dbf9f62230b4bdff27af2c34","targetId":"b-dbf9f62230b4bdff27af2c34","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"617994cb9e9eba93f0bf3265ec9ed81f11bc03c1613f1ad98c4222386b3673c8","afterSHA256":"617994cb9e9eba93f0bf3265ec9ed81f11bc03c1613f1ad98c4222386b3673c8","reason":"Same source body in authored semantic page"},{"oldId":"b-c3db11a480c42febc9a33fe3","targetId":"b-c3db11a480c42febc9a33fe3","page":"h-i-contrastive-choice","operation":"rewrite","beforeSHA256":"408cd6ffb2cdc047cdc81206dcea9516c800adf73d4e6b72def57cd03c62ead5","afterSHA256":"4d4fd3fda021683648885f34532489ec341f3515a65d48be5b2584589c4fc7c1","reason":"Same source identity with figure semantics or reading context enriched"},{"oldId":"b-cfffa6d30c1d18701b711cde","targetId":"b-cfffa6d30c1d18701b711cde","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"786ce10a6b32a492259a3dccd0a54e61cd41d28a34382fb7b5386c5f03b7ad69","afterSHA256":"786ce10a6b32a492259a3dccd0a54e61cd41d28a34382fb7b5386c5f03b7ad69","reason":"Same source body in authored semantic page"},{"oldId":"b-0ba7b2d4c162f83220e3d1b5","targetId":"b-0ba7b2d4c162f83220e3d1b5","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"239378bd7c486c10c2232e008bb79b63f795b19bee91f16af0f11835140f4d39","afterSHA256":"239378bd7c486c10c2232e008bb79b63f795b19bee91f16af0f11835140f4d39","reason":"Same source body in authored semantic page"},{"oldId":"b-f23732826278250aca148020","targetId":"b-f23732826278250aca148020","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"ff7915af8cf854e49b355f358c36a219a3421ba8f845747a30ff3b21d2168573","afterSHA256":"ff7915af8cf854e49b355f358c36a219a3421ba8f845747a30ff3b21d2168573","reason":"Same source body in authored semantic page"},{"oldId":"b-5040613cdb85475c767121f2","targetId":"b-5040613cdb85475c767121f2","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"9c85b2a94e12be025a25906ccd3086fd9e23b04cd418d9dae7558fa656dda707","afterSHA256":"9c85b2a94e12be025a25906ccd3086fd9e23b04cd418d9dae7558fa656dda707","reason":"Same source body in authored semantic page"},{"oldId":"b-44fb6083adfc5d3e3b71d95a","targetId":"b-44fb6083adfc5d3e3b71d95a","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"ccf18d20e76ccb7263acbdd725b5435a8780de7aa0dbced13935f9a1805751d6","afterSHA256":"ccf18d20e76ccb7263acbdd725b5435a8780de7aa0dbced13935f9a1805751d6","reason":"Same source body in authored semantic page"},{"oldId":"b-60da8e6f827fa4f6a042f397","targetId":"b-60da8e6f827fa4f6a042f397","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"39863b658779ff6d27c44f9e8dab11bb04fcb26103fa8aea399c9833d66f0fb8","afterSHA256":"39863b658779ff6d27c44f9e8dab11bb04fcb26103fa8aea399c9833d66f0fb8","reason":"Same source body in authored semantic page"},{"oldId":"b-53300e421b0b4b117e246bc7","targetId":"b-53300e421b0b4b117e246bc7","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"20086d7153e1371d1cafca255b5adbe6f63ea16c871f7e62104730815ed0dba0","afterSHA256":"20086d7153e1371d1cafca255b5adbe6f63ea16c871f7e62104730815ed0dba0","reason":"Same source body in authored semantic page"},{"oldId":"b-4194a57c7386dde387a6e05e","targetId":"b-4194a57c7386dde387a6e05e","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"8ede1a8933d7b277c95d3c22bae614fd909e918f8df4567a28849f542f77daf2","afterSHA256":"8ede1a8933d7b277c95d3c22bae614fd909e918f8df4567a28849f542f77daf2","reason":"Same source body in authored semantic page"},{"oldId":"b-b5ba19cfa6b1608a823de999","targetId":"b-b5ba19cfa6b1608a823de999","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"5257b41097e91faf57d27b7c23a23d989774ecfb0925a7ba0cb90cd5235d6701","afterSHA256":"5257b41097e91faf57d27b7c23a23d989774ecfb0925a7ba0cb90cd5235d6701","reason":"Same source body in authored semantic page"},{"oldId":"b-deec5114f91835172da95d4d","targetId":"b-deec5114f91835172da95d4d","page":"h-i-contrastive-choice","operation":"move","beforeSHA256":"4950a48392d5d7ae06f226181161153b21e9f621bef84d0cea466770245054cc","afterSHA256":"4950a48392d5d7ae06f226181161153b21e9f621bef84d0cea466770245054cc","reason":"Same source body in authored semantic page"},{"oldId":"b-c7e40470b0819bc5a1ba4a02","targetId":"b-c7e40470b0819bc5a1ba4a02","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"e210c6843acb737d0d3b6c1ec6e06f1a0c415da1c87049c252d6283002da6af7","afterSHA256":"e210c6843acb737d0d3b6c1ec6e06f1a0c415da1c87049c252d6283002da6af7","reason":"Same source body in authored semantic page"},{"oldId":"b-8b6fcbba3854a5aa947fa3f6","targetId":"b-8b6fcbba3854a5aa947fa3f6","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"30cc57f9cef9b262d68ee394cdfb0ddd4e5ef757bdb425bcbc1fc4968ba016bb","afterSHA256":"30cc57f9cef9b262d68ee394cdfb0ddd4e5ef757bdb425bcbc1fc4968ba016bb","reason":"Same source body in authored semantic page"},{"oldId":"b-e563ba72299cff07d2fcf763","targetId":"b-e563ba72299cff07d2fcf763","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"1e9027019191bb4ba57e8f3c872d28a368d09fd70037e9c0adb6ef60534b3811","afterSHA256":"1e9027019191bb4ba57e8f3c872d28a368d09fd70037e9c0adb6ef60534b3811","reason":"Same source body in authored semantic page"},{"oldId":"b-969f85be997130b818a761d1","targetId":"b-969f85be997130b818a761d1","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"9b9e97f7402a68932626b81e3fa3ebc2d15b582b7062edb8dabee3c6e5b37f87","afterSHA256":"9b9e97f7402a68932626b81e3fa3ebc2d15b582b7062edb8dabee3c6e5b37f87","reason":"Same source body in authored semantic page"},{"oldId":"b-67f49895bdfc7ffa944f6729","targetId":"b-67f49895bdfc7ffa944f6729","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"cf44fcc62782fb4f6bdc42c16c5187d57556a03cb7ce6065e7bd9c36d8e7d733","afterSHA256":"cf44fcc62782fb4f6bdc42c16c5187d57556a03cb7ce6065e7bd9c36d8e7d733","reason":"Same source body in authored semantic page"},{"oldId":"b-34973328becbc2e09d4613d1","targetId":"b-34973328becbc2e09d4613d1","page":"h-i-temperature-is-not-representation","operation":"move","beforeSHA256":"87e1ea5a603743a0b5ac5cb8b65030035cf53488bfde54cdab8f5df5f7e9abc2","afterSHA256":"87e1ea5a603743a0b5ac5cb8b65030035cf53488bfde54cdab8f5df5f7e9abc2","reason":"Same source body in authored semantic page"},{"oldId":"h-i-contrastive-choice-title","targetId":"b-a609340de9f4c98c639b5a19","operation":"retain-source-identity"},{"oldId":"h-i-temperature-is-not-representation-title","targetId":"b-95099b3ae0423ef1951dbfc8","operation":"retain-source-identity"},{"oldId":"h-i-temperature-is-not-representation-bridge","targetId":"b-86520e526d395673e2994673","operation":"retain-source-identity"}],"blocks":[{"id":"b-a609340de9f4c98c639b5a19","type":"h2","scope":"h-i-contrastive-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-a609340de9f4c98c639b5a19","content":"## 从三个候选算出一次选择损失","sha256":"09196987e064a8c5caa8742ea141dfee7278f3379efbbf1c21b017c91c7d3a15","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-0062a66b159b8321641a31bc","prerequisites":[{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-0062a66b159b8321641a31bc","type":"h2","scope":"explanation","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-0062a66b159b8321641a31bc","content":"## 解释、算例与证据","sha256":"d71cf15e707c8a3674b4c90a599efee783cb84da5b8c8236a1d01c3add7b4958","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-a609340de9f4c98c639b5a19","nextBlock":"b-901ef17381bd7e373e02cf5c","prerequisites":[{"id":"b-a609340de9f4c98c639b5a19","url":"#b-a609340de9f4c98c639b5a19","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-901ef17381bd7e373e02cf5c","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-901ef17381bd7e373e02cf5c","content":"# P10 · 一次对比，就是一次有答案的选择","sha256":"816b88c5ec645a7b3c65198c0878e5cfafcf53fc0dbb4e57668de2c4950697d1","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-0062a66b159b8321641a31bc","nextBlock":"b-dbf9f62230b4bdff27af2c34","prerequisites":[{"id":"b-0062a66b159b8321641a31bc","url":"#b-0062a66b159b8321641a31bc","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-dbf9f62230b4bdff27af2c34","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-dbf9f62230b4bdff27af2c34","content":"这一页把相似关系变成可优化的概率与损失。分数、温度、softmax和负对数必须能对上同一组数。","sha256":"617994cb9e9eba93f0bf3265ec9ed81f11bc03c1613f1ad98c4222386b3673c8","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-901ef17381bd7e373e02cf5c","nextBlock":"b-c3db11a480c42febc9a33fe3","prerequisites":[{"id":"b-901ef17381bd7e373e02cf5c","url":"#b-901ef17381bd7e373e02cf5c","role":"section-title"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-c3db11a480c42febc9a33fe3","type":"figure","scope":"document","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-c3db11a480c42febc9a33fe3","content":"图内标签与数值：P10 学习表示机制图，状态 2；三候选教学算例 · 指定第 1 项为正例；相似度 s；除以温度 τ = 0.5；归一化概率 p；k⁺；1；2；0.665；k₁；0.5；1；0.245；k₂；0；0；0.090；pⱼ = exp(sⱼ / τ) / Σₗ exp(sₗ / τ)；L = −ln p⁺ = 0.408\n\n三候选相似度1、0.5、0经过温度0.5缩放成2、1、0，概率0.665、0.245、0.090，指定正项损失0.408。\n\n- 三候选教学算例 · 指定第 1 项为正例\n- 相似度 s\n- 除以温度 τ = 0.5\n- 归一化概率 p\n- k⁺\n- 1\n- 2\n- 0.665\n- k₁\n- 0.5\n- 1\n- 0.245\n- k₂\n- 0\n- 0\n- 0.090\n- pⱼ = exp(sⱼ / τ) / Σₗ exp(sₗ / τ)\n- L = −ln p⁺ = 0.408三候选相似度1、0.5、0经过温度0.5缩放成2、1、0，概率0.665、0.245、0.090，指定正项损失0.408。 [查看对应图解状态](/#/l3-r2-p10/1)[查看完整图解](/course/figures/l3-r2-p10-1.html)","sha256":"4d4fd3fda021683648885f34532489ec341f3515a65d48be5b2584589c4fc7c1","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"figure":{"caption":"三候选相似度1、0.5、0经过温度0.5缩放成2、1、0，概率0.665、0.245、0.090，指定正项损失0.408。 查看对应图解状态","labels":["三候选教学算例 · 指定第 1 项为正例","相似度 s","除以温度 τ = 0.5","归一化概率 p","k⁺","1","2","0.665","k₁","0.5","1","0.245","k₂","0","0","0.090","pⱼ = exp(sⱼ / τ) / Σₗ exp(sₗ / τ)","L = −ln p⁺ = 0.408"],"description":"三候选相似度1、0.5、0经过温度0.5缩放成2、1、0，概率0.665、0.245、0.090，指定正项损失0.408。三候选教学算例 · 指定第 1 项为正例相似度 s除以温度 τ = 0.5归一化概率 pk⁺120.665k₁0.510.245k₂000.090pⱼ = exp(sⱼ / τ) / Σₗ exp(sₗ / τ)L = −ln p⁺ = 0.408","evidenceIdentity":"三候选相似度1、0.5、0经过温度0.5缩放成2、1、0，概率0.665、0.245、0.090，指定正项损失0.408。 查看对应图解状态","images":[]},"previousBlock":"b-dbf9f62230b4bdff27af2c34","nextBlock":"b-cfffa6d30c1d18701b711cde","prerequisites":[{"id":"b-901ef17381bd7e373e02cf5c","url":"#b-901ef17381bd7e373e02cf5c","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-cfffa6d30c1d18701b711cde","type":"h2","scope":"narrative","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-cfffa6d30c1d18701b711cde","content":"## 课堂讲述","sha256":"786ce10a6b32a492259a3dccd0a54e61cd41d28a34382fb7b5386c5f03b7ad69","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-c3db11a480c42febc9a33fe3","nextBlock":"b-0ba7b2d4c162f83220e3d1b5","prerequisites":[{"id":"b-901ef17381bd7e373e02cf5c","url":"#b-901ef17381bd7e373e02cf5c","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-0ba7b2d4c162f83220e3d1b5","type":"p","scope":"narrative","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-0ba7b2d4c162f83220e3d1b5","content":"现在用三个候选算一次。我们设它们与查询的相似度分别是 1、0.5、0，第一项是正例。经过温度缩放和归一化，模型给正例的概率约为 0.665。训练希望这个指定对应获得更高的相对分数。\n这里的“答案”不是狗或猫，而是：这一组候选里，哪一项与查询对应。负对数损失把这个选择变成可以优化的数值。温度会改变分数差距转换成概率后的尖锐程度，并进一步影响梯度。\n不需要把公式背下来，但要能够指着图回答：谁是查询，谁是正例，谁进入比较，误差从哪里来。这四件事清楚以后，对比学习就不再只是散点图上“拉近一点、推远一点”的动画。","sha256":"239378bd7c486c10c2232e008bb79b63f795b19bee91f16af0f11835140f4d39","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-cfffa6d30c1d18701b711cde","nextBlock":"b-f23732826278250aca148020","prerequisites":[{"id":"b-cfffa6d30c1d18701b711cde","url":"#b-cfffa6d30c1d18701b711cde","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-f23732826278250aca148020","type":"h3","scope":"infonce-as-candidate-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-f23732826278250aca148020","content":"### 把对比损失算成一道选择题","sha256":"ff7915af8cf854e49b355f358c36a219a3421ba8f845747a30ff3b21d2168573","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"把对比损失算成一道选择题","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"infonce-as-candidate-choice","formulas":[],"previousBlock":"b-0ba7b2d4c162f83220e3d1b5","nextBlock":"b-5040613cdb85475c767121f2","prerequisites":[{"id":"b-cfffa6d30c1d18701b711cde","url":"#b-cfffa6d30c1d18701b711cde","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"},{"id":"b-5040613cdb85475c767121f2","url":"#b-5040613cdb85475c767121f2","relation":"same-reasoning"},{"id":"b-44fb6083adfc5d3e3b71d95a","url":"#b-44fb6083adfc5d3e3b71d95a","relation":"same-reasoning"},{"id":"b-60da8e6f827fa4f6a042f397","url":"#b-60da8e6f827fa4f6a042f397","relation":"same-reasoning"}]},{"id":"b-5040613cdb85475c767121f2","type":"p","scope":"infonce-as-candidate-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-5040613cdb85475c767121f2","content":"设查询的三个候选logit为2、1、0，第一项是已知正例。这些是**温度缩放后的分数**，不是三个原始余弦值。softmax分母为 $e^2+e^1+e^0\\approx11.107$，概率约为 $(0.6652,0.2447,0.0900)$，正例损失 $-\\ln0.6652\\approx0.4076$。","sha256":"9c85b2a94e12be025a25906ccd3086fd9e23b04cd418d9dae7558fa656dda707","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"把对比损失算成一道选择题","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"infonce-as-candidate-choice","formulas":[{"latex":"e^2+e^1+e^0\\approx11.107","definitionContext":"设查询的三个候选logit为2、1、0，第一项是已知正例。这些是**温度缩放后的分数**，不是三个原始余弦值。softmax分母为 $e^2+e^1+e^0\\approx11.107$，概率约为 $(0.6652,0.2447,0.0900)$，正例损失 $-\\ln0.6652\\approx0.4076$。\n一般式为 $L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}$，分母包含正例。提高正例相对分数会降低损失；把所有分数同时加一个常数不会改变概率，所以目标关注相对选择而非绝对分数大。\n实际训练中分数由图像经编码器算出，损失反传到参数。手算这一行只解释目标，不是模型实验。接到LAB 07时，应沿真实图像→两视图→向量→logit→loss→参数变化逐项找到对应对象。"},{"latex":"(0.6652,0.2447,0.0900)","definitionContext":"设查询的三个候选logit为2、1、0，第一项是已知正例。这些是**温度缩放后的分数**，不是三个原始余弦值。softmax分母为 $e^2+e^1+e^0\\approx11.107$，概率约为 $(0.6652,0.2447,0.0900)$，正例损失 $-\\ln0.6652\\approx0.4076$。\n一般式为 $L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}$，分母包含正例。提高正例相对分数会降低损失；把所有分数同时加一个常数不会改变概率，所以目标关注相对选择而非绝对分数大。\n实际训练中分数由图像经编码器算出，损失反传到参数。手算这一行只解释目标，不是模型实验。接到LAB 07时，应沿真实图像→两视图→向量→logit→loss→参数变化逐项找到对应对象。"},{"latex":"-\\ln0.6652\\approx0.4076","definitionContext":"设查询的三个候选logit为2、1、0，第一项是已知正例。这些是**温度缩放后的分数**，不是三个原始余弦值。softmax分母为 $e^2+e^1+e^0\\approx11.107$，概率约为 $(0.6652,0.2447,0.0900)$，正例损失 $-\\ln0.6652\\approx0.4076$。\n一般式为 $L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}$，分母包含正例。提高正例相对分数会降低损失；把所有分数同时加一个常数不会改变概率，所以目标关注相对选择而非绝对分数大。\n实际训练中分数由图像经编码器算出，损失反传到参数。手算这一行只解释目标，不是模型实验。接到LAB 07时，应沿真实图像→两视图→向量→logit→loss→参数变化逐项找到对应对象。"}],"previousBlock":"b-f23732826278250aca148020","nextBlock":"b-44fb6083adfc5d3e3b71d95a","prerequisites":[{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"},{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","relation":"same-reasoning"},{"id":"b-44fb6083adfc5d3e3b71d95a","url":"#b-44fb6083adfc5d3e3b71d95a","relation":"same-reasoning"},{"id":"b-60da8e6f827fa4f6a042f397","url":"#b-60da8e6f827fa4f6a042f397","relation":"same-reasoning"}]},{"id":"b-44fb6083adfc5d3e3b71d95a","type":"p","scope":"infonce-as-candidate-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-44fb6083adfc5d3e3b71d95a","content":"一般式为 $L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}$，分母包含正例。提高正例相对分数会降低损失；把所有分数同时加一个常数不会改变概率，所以目标关注相对选择而非绝对分数大。","sha256":"ccf18d20e76ccb7263acbdd725b5435a8780de7aa0dbced13935f9a1805751d6","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"把对比损失算成一道选择题","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"infonce-as-candidate-choice","formulas":[{"latex":"L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}","definitionContext":"设查询的三个候选logit为2、1、0，第一项是已知正例。这些是**温度缩放后的分数**，不是三个原始余弦值。softmax分母为 $e^2+e^1+e^0\\approx11.107$，概率约为 $(0.6652,0.2447,0.0900)$，正例损失 $-\\ln0.6652\\approx0.4076$。\n一般式为 $L=-\\log\\{\\exp(s_+/\\tau)/\\sum_j\\exp(s_j/\\tau)\\}$，分母包含正例。提高正例相对分数会降低损失；把所有分数同时加一个常数不会改变概率，所以目标关注相对选择而非绝对分数大。\n实际训练中分数由图像经编码器算出，损失反传到参数。手算这一行只解释目标，不是模型实验。接到LAB 07时，应沿真实图像→两视图→向量→logit→loss→参数变化逐项找到对应对象。"}],"previousBlock":"b-5040613cdb85475c767121f2","nextBlock":"b-60da8e6f827fa4f6a042f397","prerequisites":[{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"},{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","relation":"same-reasoning"},{"id":"b-5040613cdb85475c767121f2","url":"#b-5040613cdb85475c767121f2","relation":"same-reasoning"},{"id":"b-60da8e6f827fa4f6a042f397","url":"#b-60da8e6f827fa4f6a042f397","relation":"same-reasoning"}]},{"id":"b-60da8e6f827fa4f6a042f397","type":"p","scope":"infonce-as-candidate-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-60da8e6f827fa4f6a042f397","content":"实际训练中分数由图像经编码器算出，损失反传到参数。手算这一行只解释目标，不是模型实验。接到LAB 07时，应沿真实图像→两视图→向量→logit→loss→参数变化逐项找到对应对象。","sha256":"39863b658779ff6d27c44f9e8dab11bb04fcb26103fa8aea399c9833d66f0fb8","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"把对比损失算成一道选择题","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"infonce-as-candidate-choice","formulas":[],"previousBlock":"b-44fb6083adfc5d3e3b71d95a","nextBlock":"b-6fc99bf514b04d49a0de009e","prerequisites":[{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"},{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","relation":"same-reasoning"},{"id":"b-5040613cdb85475c767121f2","url":"#b-5040613cdb85475c767121f2","relation":"same-reasoning"},{"id":"b-44fb6083adfc5d3e3b71d95a","url":"#b-44fb6083adfc5d3e3b71d95a","relation":"same-reasoning"}]},{"id":"b-6fc99bf514b04d49a0de009e","type":"h4","scope":"h-i-contrastive-choice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-6fc99bf514b04d49a0de009e","content":"#### 图示条件与公式约定","sha256":"ef7f915c1ae63ed67bd23fecf050249273ba0efa8965d2c8d1c1c6b2d3178122","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-60da8e6f827fa4f6a042f397","nextBlock":"b-53300e421b0b4b117e246bc7","prerequisites":[{"id":"b-f23732826278250aca148020","url":"#b-f23732826278250aca148020","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-53300e421b0b4b117e246bc7","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-53300e421b0b4b117e246bc7","content":"教学设定 s=[1,.5,0]，τ=.5，logits=[2,1,0]；p=[.6652409558,.2447284711,.0900305732]；−ln p+=.4076059644。分母含三个候选，不含查询自身；非模型输出。降低温度提高当前最高分的尖锐程度，并非对所有样本一概增大梯度。","sha256":"20086d7153e1371d1cafca255b5adbe6f63ea16c871f7e62104730815ed0dba0","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-6fc99bf514b04d49a0de009e","nextBlock":"b-10e20f2c13f5f1437bec6d96","prerequisites":[{"id":"b-6fc99bf514b04d49a0de009e","url":"#b-6fc99bf514b04d49a0de009e","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-10e20f2c13f5f1437bec6d96","type":"h4","scope":"retained-reading","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-10e20f2c13f5f1437bec6d96","content":"#### 这条线索的展开与后续阅读","sha256":"48b8229f7559b36ed4d5628416e3991e5c73293fbce43374db67386c8736f3bc","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-53300e421b0b4b117e246bc7","nextBlock":"b-4194a57c7386dde387a6e05e","prerequisites":[{"id":"b-6fc99bf514b04d49a0de009e","url":"#b-6fc99bf514b04d49a0de009e","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-4194a57c7386dde387a6e05e","type":"ul","scope":"retained-reading","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-4194a57c7386dde387a6e05e","content":"- [对比任务由我们构造｜核心改动怎样工作](/supplement.html?return=l3-r2-p10/0#/l3-infonce-matrix-mechanism/0) 本页说明\n- [对比任务由我们构造｜一起算一个完整例子](/supplement.html?return=l3-r2-p10/0#/l3-infonce-matrix-example/0) 本页说明","sha256":"8ede1a8933d7b277c95d3c22bae614fd909e918f8df4567a28849f542f77daf2","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-10e20f2c13f5f1437bec6d96","nextBlock":"b-b5ba19cfa6b1608a823de999","prerequisites":[{"id":"b-10e20f2c13f5f1437bec6d96","url":"#b-10e20f2c13f5f1437bec6d96","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-b5ba19cfa6b1608a823de999","type":"li","scope":"retained-reading","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-b5ba19cfa6b1608a823de999","content":"- [对比任务由我们构造｜核心改动怎样工作](/supplement.html?return=l3-r2-p10/0#/l3-infonce-matrix-mechanism/0) 本页说明","sha256":"5257b41097e91faf57d27b7c23a23d989774ecfb0925a7ba0cb90cd5235d6701","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-4194a57c7386dde387a6e05e","nextBlock":"b-deec5114f91835172da95d4d","prerequisites":[{"id":"b-10e20f2c13f5f1437bec6d96","url":"#b-10e20f2c13f5f1437bec6d96","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-deec5114f91835172da95d4d","type":"li","scope":"retained-reading","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-deec5114f91835172da95d4d","content":"- [对比任务由我们构造｜一起算一个完整例子](/supplement.html?return=l3-r2-p10/0#/l3-infonce-matrix-example/0) 本页说明","sha256":"4950a48392d5d7ae06f226181161153b21e9f621bef84d0cea466770245054cc","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-contrastive-choice","title":"从三个候选算出一次选择损失","number":1},"sectionTitle":"从三个候选算出一次选择损失","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-b5ba19cfa6b1608a823de999","nextBlock":null,"prerequisites":[{"id":"b-10e20f2c13f5f1437bec6d96","url":"#b-10e20f2c13f5f1437bec6d96","role":"section-title"},{"id":"b-dbf9f62230b4bdff27af2c34","url":"#b-dbf9f62230b4bdff27af2c34","role":"problem-context"}],"relatedBlocks":[{"id":"b-c3db11a480c42febc9a33fe3","url":"#b-c3db11a480c42febc9a33fe3","relation":"figure-and-explanation"}]},{"id":"b-95099b3ae0423ef1951dbfc8","type":"h2","scope":"h-i-temperature-is-not-representation","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-95099b3ae0423ef1951dbfc8","content":"## 温度改变概率和梯度，不改变原始排序","sha256":"055da9568ee827a81a726d9292111c7f1bb103fa4bbe338559045aa09a7e01bd","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变概率和梯度，不改变原始排序","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-86520e526d395673e2994673","prerequisites":[{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-86520e526d395673e2994673","type":"p","scope":"h-i-temperature-is-not-representation","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-86520e526d395673e2994673","content":"固定另一组相似度(.8,.4,.2)，把温度当唯一变化量。","sha256":"1159907ab87054eef550a439d04c8f307e789a06548ee9d998f55027d172c372","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变概率和梯度，不改变原始排序","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-95099b3ae0423ef1951dbfc8","nextBlock":"b-c7e40470b0819bc5a1ba4a02","prerequisites":[{"id":"b-95099b3ae0423ef1951dbfc8","url":"#b-95099b3ae0423ef1951dbfc8","role":"section-title"}],"relatedBlocks":[]},{"id":"b-c7e40470b0819bc5a1ba4a02","type":"h3","scope":"temperature-ranking-probability-gradient","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-c7e40470b0819bc5a1ba4a02","content":"### 温度改变什么，不改变什么？","sha256":"e210c6843acb737d0d3b6c1ec6e06f1a0c415da1c87049c252d6283002da6af7","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变什么，不改变什么？","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"temperature-ranking-probability-gradient","formulas":[],"previousBlock":"b-86520e526d395673e2994673","nextBlock":"b-8b6fcbba3854a5aa947fa3f6","prerequisites":[{"id":"b-95099b3ae0423ef1951dbfc8","url":"#b-95099b3ae0423ef1951dbfc8","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[{"id":"b-8b6fcbba3854a5aa947fa3f6","url":"#b-8b6fcbba3854a5aa947fa3f6","relation":"same-reasoning"},{"id":"b-e563ba72299cff07d2fcf763","url":"#b-e563ba72299cff07d2fcf763","relation":"same-reasoning"},{"id":"b-969f85be997130b818a761d1","url":"#b-969f85be997130b818a761d1","relation":"same-reasoning"}]},{"id":"b-8b6fcbba3854a5aa947fa3f6","type":"p","scope":"temperature-ranking-probability-gradient","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-8b6fcbba3854a5aa947fa3f6","content":"固定相似度为 $(0.8,0.4,0.2)$，第一项是正例。温度1、0.5、0.1时，正例概率分别约0.4506、0.5713、0.9796。排序完全不变，但概率越来越集中。若正例分数低于最强负例，低温度也会更尖锐地放大错误选择。","sha256":"30cc57f9cef9b262d68ee394cdfb0ddd4e5ef757bdb425bcbc1fc4968ba016bb","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变什么，不改变什么？","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"temperature-ranking-probability-gradient","formulas":[{"latex":"(0.8,0.4,0.2)","definitionContext":"固定相似度为 $(0.8,0.4,0.2)$，第一项是正例。温度1、0.5、0.1时，正例概率分别约0.4506、0.5713、0.9796。排序完全不变，但概率越来越集中。若正例分数低于最强负例，低温度也会更尖锐地放大错误选择。\n梯度能解释其作用：$\\partial L/\\partial s_+=(p_+-1)/\\tau$，负例为 $p_j/\\tau$。温度既改变分母中的尺度，也改变概率。因此“温度越低，梯度越大”并不总成立：正例已经几乎确定时，$1-p_+$也会接近零。\n把温度调低造成的loss下降，不能当作表示已经改善。温度是训练条件，最终仍用固定读出协议评价。课堂上可以让学生先预测哪一项概率增加，再计算；避免同时改相似度、候选数和温度，使原因无法辨认。"}],"previousBlock":"b-c7e40470b0819bc5a1ba4a02","nextBlock":"b-e563ba72299cff07d2fcf763","prerequisites":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","relation":"same-reasoning"},{"id":"b-e563ba72299cff07d2fcf763","url":"#b-e563ba72299cff07d2fcf763","relation":"same-reasoning"},{"id":"b-969f85be997130b818a761d1","url":"#b-969f85be997130b818a761d1","relation":"same-reasoning"}]},{"id":"b-e563ba72299cff07d2fcf763","type":"p","scope":"temperature-ranking-probability-gradient","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-e563ba72299cff07d2fcf763","content":"梯度能解释其作用：$\\partial L/\\partial s_+=(p_+-1)/\\tau$，负例为 $p_j/\\tau$。温度既改变分母中的尺度，也改变概率。因此“温度越低，梯度越大”并不总成立：正例已经几乎确定时，$1-p_+$也会接近零。","sha256":"1e9027019191bb4ba57e8f3c872d28a368d09fd70037e9c0adb6ef60534b3811","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变什么，不改变什么？","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"temperature-ranking-probability-gradient","formulas":[{"latex":"\\partial L/\\partial s_+=(p_+-1)/\\tau","definitionContext":"固定相似度为 $(0.8,0.4,0.2)$，第一项是正例。温度1、0.5、0.1时，正例概率分别约0.4506、0.5713、0.9796。排序完全不变，但概率越来越集中。若正例分数低于最强负例，低温度也会更尖锐地放大错误选择。\n梯度能解释其作用：$\\partial L/\\partial s_+=(p_+-1)/\\tau$，负例为 $p_j/\\tau$。温度既改变分母中的尺度，也改变概率。因此“温度越低，梯度越大”并不总成立：正例已经几乎确定时，$1-p_+$也会接近零。\n把温度调低造成的loss下降，不能当作表示已经改善。温度是训练条件，最终仍用固定读出协议评价。课堂上可以让学生先预测哪一项概率增加，再计算；避免同时改相似度、候选数和温度，使原因无法辨认。"},{"latex":"p_j/\\tau","definitionContext":"固定相似度为 $(0.8,0.4,0.2)$，第一项是正例。温度1、0.5、0.1时，正例概率分别约0.4506、0.5713、0.9796。排序完全不变，但概率越来越集中。若正例分数低于最强负例，低温度也会更尖锐地放大错误选择。\n梯度能解释其作用：$\\partial L/\\partial s_+=(p_+-1)/\\tau$，负例为 $p_j/\\tau$。温度既改变分母中的尺度，也改变概率。因此“温度越低，梯度越大”并不总成立：正例已经几乎确定时，$1-p_+$也会接近零。\n把温度调低造成的loss下降，不能当作表示已经改善。温度是训练条件，最终仍用固定读出协议评价。课堂上可以让学生先预测哪一项概率增加，再计算；避免同时改相似度、候选数和温度，使原因无法辨认。"},{"latex":"1-p_+","definitionContext":"固定相似度为 $(0.8,0.4,0.2)$，第一项是正例。温度1、0.5、0.1时，正例概率分别约0.4506、0.5713、0.9796。排序完全不变，但概率越来越集中。若正例分数低于最强负例，低温度也会更尖锐地放大错误选择。\n梯度能解释其作用：$\\partial L/\\partial s_+=(p_+-1)/\\tau$，负例为 $p_j/\\tau$。温度既改变分母中的尺度，也改变概率。因此“温度越低，梯度越大”并不总成立：正例已经几乎确定时，$1-p_+$也会接近零。\n把温度调低造成的loss下降，不能当作表示已经改善。温度是训练条件，最终仍用固定读出协议评价。课堂上可以让学生先预测哪一项概率增加，再计算；避免同时改相似度、候选数和温度，使原因无法辨认。"}],"previousBlock":"b-8b6fcbba3854a5aa947fa3f6","nextBlock":"b-969f85be997130b818a761d1","prerequisites":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","relation":"same-reasoning"},{"id":"b-8b6fcbba3854a5aa947fa3f6","url":"#b-8b6fcbba3854a5aa947fa3f6","relation":"same-reasoning"},{"id":"b-969f85be997130b818a761d1","url":"#b-969f85be997130b818a761d1","relation":"same-reasoning"}]},{"id":"b-969f85be997130b818a761d1","type":"p","scope":"temperature-ranking-probability-gradient","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-969f85be997130b818a761d1","content":"把温度调低造成的loss下降，不能当作表示已经改善。温度是训练条件，最终仍用固定读出协议评价。课堂上可以让学生先预测哪一项概率增加，再计算；避免同时改相似度、候选数和温度，使原因无法辨认。","sha256":"9b9e97f7402a68932626b81e3fa3ebc2d15b582b7062edb8dabee3c6e5b37f87","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变什么，不改变什么？","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":"temperature-ranking-probability-gradient","formulas":[],"previousBlock":"b-e563ba72299cff07d2fcf763","nextBlock":"b-67f49895bdfc7ffa944f6729","prerequisites":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","relation":"same-reasoning"},{"id":"b-8b6fcbba3854a5aa947fa3f6","url":"#b-8b6fcbba3854a5aa947fa3f6","relation":"same-reasoning"},{"id":"b-e563ba72299cff07d2fcf763","url":"#b-e563ba72299cff07d2fcf763","relation":"same-reasoning"}]},{"id":"b-67f49895bdfc7ffa944f6729","type":"h2","scope":"practice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-67f49895bdfc7ffa944f6729","content":"## 沿这个问题继续","sha256":"cf44fcc62782fb4f6bdc42c16c5187d57556a03cb7ce6065e7bd9c36d8e7d733","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变概率和梯度，不改变原始排序","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-969f85be997130b818a761d1","nextBlock":"b-34973328becbc2e09d4613d1","prerequisites":[{"id":"b-c7e40470b0819bc5a1ba4a02","url":"#b-c7e40470b0819bc5a1ba4a02","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-34973328becbc2e09d4613d1","type":"p","scope":"practice","url":"https://codingai-lec03.pages.dev/course/pages/l3-r2-p10.html#b-34973328becbc2e09d4613d1","content":"先算画面2、1、0，再读温度块；LAB 07开头只做数值热身即可，真实训练另读后段。","sha256":"87e1ea5a603743a0b5ac5cb8b65030035cf53488bfde54cdab8f5df5f7e9abc2","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-view-objective","title":"视图关系怎样成为学习目标，又会牺牲什么？"},"page":{"id":"h-i-temperature-is-not-representation","title":"温度改变概率和梯度，不改变原始排序","number":2},"sectionTitle":"温度改变概率和梯度，不改变原始排序","currentQuestion":"视图关系怎样成为学习目标，又会牺牲什么？","sourceSlides":["l3-r2-p10"],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-67f49895bdfc7ffa944f6729","nextBlock":null,"prerequisites":[{"id":"b-67f49895bdfc7ffa944f6729","url":"#b-67f49895bdfc7ffa944f6729","role":"section-title"},{"id":"b-86520e526d395673e2994673","url":"#b-86520e526d395673e2994673","role":"problem-context"}],"relatedBlocks":[]}]}
