{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"LAB 19 · 新域：捷径反转与少标签适配","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html","markdown":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.md","pages":[{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","unit":"怎样判断表示支持了哪种使用方式？","unitId":"i-use-and-evaluate","chapter":"I","number":1},{"id":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","title":"已完成的基准运行","unit":"怎样判断表示支持了哪种使用方式？","unitId":"i-use-and-evaluate","chapter":"I","number":2},{"id":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","title":"旧版热身（历史参考）","unit":"怎样判断表示支持了哪种使用方式？","unitId":"i-use-and-evaluate","chapter":"I","number":3}],"aliases":[{"oldId":"b-81be645f8028d9be1291628d","targetId":"b-81be645f8028d9be1291628d","operation":"historical-explanation","sourceScope":"block-b8f620816c50450aa37772c7ee9ebfb1"},{"oldId":"b-8e535f2062d55ade4954215f","targetId":"b-8e535f2062d55ade4954215f","operation":"historical-explanation","sourceScope":"block-b8f620816c50450aa37772c7ee9ebfb1"},{"oldId":"b-cb7a967aa6be6adcdc3ce65e","targetId":"b-cb7a967aa6be6adcdc3ce65e","operation":"historical-explanation","sourceScope":"block-b8f620816c50450aa37772c7ee9ebfb1"},{"oldId":"b-2dcc91f0138cf13087cb2ab1","targetId":"b-2dcc91f0138cf13087cb2ab1","operation":"historical-explanation","sourceScope":"block-b8f620816c50450aa37772c7ee9ebfb1"},{"oldId":"b-e813a828e9909db7c2f76e8d","targetId":"b-e813a828e9909db7c2f76e8d","page":"reading-opening","operation":"move","beforeSHA256":"0675fc79fea46f9d5dbf8816f75685d7bfba2dcc462ff7a747f745d9c10c7028","afterSHA256":"0675fc79fea46f9d5dbf8816f75685d7bfba2dcc462ff7a747f745d9c10c7028","reason":"Same source body in authored semantic page"},{"oldId":"b-59fb1c62589359d23a6cdc14","targetId":"b-59fb1c62589359d23a6cdc14","page":"reading-opening","operation":"move","beforeSHA256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","afterSHA256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","reason":"Same source body in authored semantic page"},{"oldId":"b-5fb18fdf37f934b6e8c5043a","targetId":"b-5fb18fdf37f934b6e8c5043a","page":"reading-opening","operation":"move","beforeSHA256":"acab63401590ec93c084e0b85d6377f8d181ccfd7b8a41fccc3b4e91a788f49b","afterSHA256":"acab63401590ec93c084e0b85d6377f8d181ccfd7b8a41fccc3b4e91a788f49b","reason":"Same source body in authored semantic page"},{"oldId":"b-d64158245c7486673edb77bb","targetId":"b-d64158245c7486673edb77bb","page":"reading-opening","operation":"move","beforeSHA256":"f22152fd55dcdb0090b5653d37145694fd19388d31e10226549464fe8b483578","afterSHA256":"f22152fd55dcdb0090b5653d37145694fd19388d31e10226549464fe8b483578","reason":"Same source body in authored semantic page"},{"oldId":"b-0c2cebb140fe488bb221237c","targetId":"b-0c2cebb140fe488bb221237c","page":"reading-opening","operation":"move","beforeSHA256":"efc07be0d238c97b2a0f2a3e1e141f27691e7d1aadb5b0bc2662d7d40218327f","afterSHA256":"efc07be0d238c97b2a0f2a3e1e141f27691e7d1aadb5b0bc2662d7d40218327f","reason":"Same source body in authored semantic page"},{"oldId":"b-d0a98e20d63b9d4146f301b3","targetId":"b-d0a98e20d63b9d4146f301b3","page":"reading-opening","operation":"move","beforeSHA256":"f939f4fcd7214171d514e66879dda592e8e4b3d99f53ac51ce338d722a4c392a","afterSHA256":"f939f4fcd7214171d514e66879dda592e8e4b3d99f53ac51ce338d722a4c392a","reason":"Same source body in authored semantic page"},{"oldId":"b-101f47a9d0f60f75f4d30115","targetId":"b-101f47a9d0f60f75f4d30115","page":"reading-opening","operation":"move","beforeSHA256":"75a634c22ce4d597f2d453bc3ba907044396286d690db520fee9ee32b8b05e1f","afterSHA256":"75a634c22ce4d597f2d453bc3ba907044396286d690db520fee9ee32b8b05e1f","reason":"Same source body in authored semantic page"},{"oldId":"b-a9c4882d2743c3b32bd5242c","targetId":"b-a9c4882d2743c3b32bd5242c","page":"reading-opening","operation":"move","beforeSHA256":"cae126f82aa0c2c50550edda145fe9373e853259b34d0df5998047c2d99bf785","afterSHA256":"cae126f82aa0c2c50550edda145fe9373e853259b34d0df5998047c2d99bf785","reason":"Same source body in authored semantic page"},{"oldId":"b-e8dc8d80147fa13f561ee0ed","targetId":"b-e8dc8d80147fa13f561ee0ed","page":"reading-opening","operation":"move","beforeSHA256":"27b60dcda94fba59f6af2ff7c1b50efba3c5b073354ca4122c0762fb8a70a6ef","afterSHA256":"27b60dcda94fba59f6af2ff7c1b50efba3c5b073354ca4122c0762fb8a70a6ef","reason":"Same source body in authored semantic page"},{"oldId":"b-1fbffe56dd364088437265c6","targetId":"b-1fbffe56dd364088437265c6","page":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","operation":"move","beforeSHA256":"70efe3096d536ddf0d6f0f7335815da85d73017a47a0e52cac5d2621805a3c53","afterSHA256":"70efe3096d536ddf0d6f0f7335815da85d73017a47a0e52cac5d2621805a3c53","reason":"Same source body in authored semantic page"},{"oldId":"b-f2f09ea0a844a63cd4703c7b","targetId":"b-f2f09ea0a844a63cd4703c7b","page":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","operation":"move","beforeSHA256":"ff4e2caa2efcd2a7e24e155ecad4f46e58bf2f1bb641ebcf47707b657cc53d56","afterSHA256":"ff4e2caa2efcd2a7e24e155ecad4f46e58bf2f1bb641ebcf47707b657cc53d56","reason":"Same source body in authored semantic page"},{"oldId":"b-39733f38869e1cf13006d5ca","targetId":"b-39733f38869e1cf13006d5ca","page":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","operation":"move","beforeSHA256":"35518f6cfbb15b5a82699b09e2c8f3927ae63badfe6c426c38ccadf53baa1054","afterSHA256":"35518f6cfbb15b5a82699b09e2c8f3927ae63badfe6c426c38ccadf53baa1054","reason":"Same source body in authored semantic page"},{"oldId":"b-990548bbe9ecc3202679d08a","targetId":"b-990548bbe9ecc3202679d08a","page":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","operation":"move","beforeSHA256":"8cc3d72ee3e45b95d7d873936acad4fa2a00258d3a865a05c0f27ac2aa843c6b","afterSHA256":"8cc3d72ee3e45b95d7d873936acad4fa2a00258d3a865a05c0f27ac2aa843c6b","reason":"Same source body in authored semantic page"},{"oldId":"b-37d59f020b88f451d3275386","targetId":"b-37d59f020b88f451d3275386","page":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","operation":"move","beforeSHA256":"22776016622c2addaf705c770c88971c82973c938ae33e183a9feb3b49e49de1","afterSHA256":"22776016622c2addaf705c770c88971c82973c938ae33e183a9feb3b49e49de1","reason":"Same source body in authored semantic page"},{"oldId":"b-ae63b18da5a6adff8e1cc2da","targetId":"b-ae63b18da5a6adff8e1cc2da","page":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","operation":"move","beforeSHA256":"e5c542ac9eaa3e8830cbf8ff2616dedc089473c3d44be23349ecd3d049b6d0f9","afterSHA256":"e5c542ac9eaa3e8830cbf8ff2616dedc089473c3d44be23349ecd3d049b6d0f9","reason":"Same source body in authored semantic page"},{"oldId":"b-8723ee644104f6ca83e2ba1f","targetId":"b-8723ee644104f6ca83e2ba1f","page":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","operation":"move","beforeSHA256":"c96c8bb83ebcc08766fb28408f8fb954ca4776be883cbd3d4947d0e4f2c839cb","afterSHA256":"c96c8bb83ebcc08766fb28408f8fb954ca4776be883cbd3d4947d0e4f2c839cb","reason":"Same source body in authored semantic page"},{"oldId":"block-781073c3fc214fd6b23ae0a54a479e1d--已完成的基准运行","targetId":"b-1fbffe56dd364088437265c6","operation":"retain-source-identity"},{"oldId":"block-b8f620816c50450aa37772c7ee9ebfb1--旧版热身历史参考","targetId":"b-37d59f020b88f451d3275386","operation":"retain-source-identity"}],"blocks":[{"id":"b-e813a828e9909db7c2f76e8d","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-e813a828e9909db7c2f76e8d","content":"# LAB 19 · 新域：捷径反转与少标签适配","sha256":"0675fc79fea46f9d5dbf8816f75685d7bfba2dcc462ff7a747f745d9c10c7028","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-59fb1c62589359d23a6cdc14","prerequisites":[{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-59fb1c62589359d23a6cdc14","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-59fb1c62589359d23a6cdc14","content":"按问题继续","sha256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-e813a828e9909db7c2f76e8d","nextBlock":"b-5fb18fdf37f934b6e8c5043a","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"}],"relatedBlocks":[]},{"id":"b-5fb18fdf37f934b6e8c5043a","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-5fb18fdf37f934b6e8c5043a","content":"源域捷径、目标域反转、少标签适配与同预算scratch","sha256":"acab63401590ec93c084e0b85d6377f8d181ccfd7b8a41fccc3b4e91a788f49b","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-59fb1c62589359d23a6cdc14","nextBlock":"b-d64158245c7486673edb77bb","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-d64158245c7486673edb77bb","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-d64158245c7486673edb77bb","content":"可先阅读已有结果，再决定是否运行。重算时请核对各节记录的数据、参数、环境与日期。","sha256":"f22152fd55dcdb0090b5653d37145694fd19388d31e10226549464fe8b483578","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-5fb18fdf37f934b6e8c5043a","nextBlock":"b-0c2cebb140fe488bb221237c","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-0c2cebb140fe488bb221237c","type":"p","scope":"block-d066bd38245d4d849bd1b05e2cf09b01","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-0c2cebb140fe488bb221237c","content":"**学习路径：** [表示怎样迁移到新任务](/course/study/readout-transfer.html)","sha256":"efc07be0d238c97b2a0f2a3e1e141f27691e7d1aadb5b0bc2662d7d40218327f","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-d64158245c7486673edb77bb","nextBlock":"b-d0a98e20d63b9d4146f301b3","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-d0a98e20d63b9d4146f301b3","type":"p","scope":"block-d066bd38245d4d849bd1b05e2cf09b01","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-d0a98e20d63b9d4146f301b3","content":"这是[CLS 06](https://deepnote.com/project/38755e4e-23f6-4f5f-8c68-8a2e4114b1c1/notebook/c0645a4db6e04188ab5b119e87c53bed)的新域支路：**到新环境变差，与迁移不如从头训练，是同一句话吗？**","sha256":"f939f4fcd7214171d514e66879dda592e8e4b3d99f53ac51ce338d722a4c392a","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-0c2cebb140fe488bb221237c","nextBlock":"b-101f47a9d0f60f75f4d30115","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-101f47a9d0f60f75f4d30115","type":"p","scope":"block-d066bd38245d4d849bd1b05e2cf09b01","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-101f47a9d0f60f75f4d30115","content":"先预测两维线索中哪一维会失效，再读源域、目标域直接使用、32标签适配与同预算scratch四项评价。分别算“适配相对直接使用”和“迁移相对scratch”的差值；它们回答不同问题。","sha256":"75a634c22ce4d597f2d453bc3ba907044396286d690db520fee9ee32b8b05e1f","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-d0a98e20d63b9d4146f301b3","nextBlock":"b-a9c4882d2743c3b32bd5242c","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-a9c4882d2743c3b32bd5242c","type":"p","scope":"block-d066bd38245d4d849bd1b05e2cf09b01","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-a9c4882d2743c3b32bd5242c","content":"你的产出是用这两个差值写两句范围明确的判断。输入是解析线索，模型确实训练，但不是照片实验。[P24](/course/pages/l3-r2-p24.html)及[新域与负迁移](/course/blocks/environment-shift-versus-negative-transfer.html)保留上下文；需要真实图像的参数适配时接[LAB 02](https://deepnote.com/project/38755e4e-23f6-4f5f-8c68-8a2e4114b1c1/notebook/4bd450d54870432db91c80a4df563b8e)。","sha256":"cae126f82aa0c2c50550edda145fe9373e853259b34d0df5998047c2d99bf785","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-101f47a9d0f60f75f4d30115","nextBlock":"b-e8dc8d80147fa13f561ee0ed","prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-e8dc8d80147fa13f561ee0ed","type":"pre","scope":"block-57aeca83ffea4a7c9f6d46529f58fa18","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-e8dc8d80147fa13f561ee0ed","content":"```\n# Writable ephemeral workspace for detached readonly cloud runs.\nimport os, tempfile\nos.chdir(tempfile.mkdtemp(prefix='lec03_lab22_'))\n\nimport numpy as np\ndef data(seed,n,environment):\n    r=np.random.default_rng(seed); y=r.integers(0,2,n); sign=2*y-1\n    x=np.c_[sign+r.normal(0,1.,n),environment*sign+r.normal(0,.15,n),np.ones(n)]\n    return x,y\ndef train(x,y,w,steps,lr=.1,l2=.01):\n    w=w.copy()\n    for _ in range(steps):\n        p=1/(1+np.exp(-np.clip(x@w,-30,30))); w-=lr*(x.T@(p-y)/len(y)+l2*np.r_[w[:2],0])\n    return w\ndef acc(w,d): x,y=d; return float(((x@w>=0)==y).mean())\nsource=data(220,512,1); source_test=data(221,512,1); adapt=data(222,32,-1); target_test=data(223,512,-1)\nw=train(*source,np.zeros(3),500); adapted=train(*adapt,w,150); scratch=train(*adapt,np.zeros(3),150)\nprint('source-trained weights stable/spurious/bias',w.round(3).tolist())\nresult={'source_holdout':acc(w,source_test),'target_zero_shot':acc(w,target_test),'target_adapt32':acc(adapted,target_test),'target_scratch32':acc(scratch,target_test)}\nprint(result); print('adaptation gain over zero-shot',round(result['target_adapt32']-result['target_zero_shot'],4),'transfer advantage vs scratch',round(result['target_adapt32']-result['target_scratch32'],4))\nprint('test seeds 221/223 never used by optimizer; adaptation seed222 only')\n```","sha256":"27b60dcda94fba59f6af2ff7c1b50efba3c5b073354ca4122c0762fb8a70a6ef","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-opening","title":"LAB 19 · 新域：捷径反转与少标签适配","number":1},"sectionTitle":"LAB 19 · 新域：捷径反转与少标签适配","currentQuestion":"LAB 19 · 新域：捷径反转与少标签适配","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-a9c4882d2743c3b32bd5242c","nextBlock":null,"prerequisites":[{"id":"b-e813a828e9909db7c2f76e8d","url":"#b-e813a828e9909db7c2f76e8d","role":"section-title"},{"id":"b-59fb1c62589359d23a6cdc14","url":"#b-59fb1c62589359d23a6cdc14","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-1fbffe56dd364088437265c6","type":"h2","scope":"block-781073c3fc214fd6b23ae0a54a479e1d","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-1fbffe56dd364088437265c6","content":"## 已完成的基准运行","sha256":"70efe3096d536ddf0d6f0f7335815da85d73017a47a0e52cac5d2621805a3c53","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","title":"已完成的基准运行","number":2},"sectionTitle":"已完成的基准运行","currentQuestion":"已完成的基准运行","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-f2f09ea0a844a63cd4703c7b","prerequisites":[{"id":"b-f2f09ea0a844a63cd4703c7b","url":"#b-f2f09ea0a844a63cd4703c7b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-f2f09ea0a844a63cd4703c7b","type":"p","scope":"block-781073c3fc214fd6b23ae0a54a479e1d","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-f2f09ea0a844a63cd4703c7b","content":"以下是本轮本地独立 Python 进程的实际标准输出，云端执行另行记录。","sha256":"ff4e2caa2efcd2a7e24e155ecad4f46e58bf2f1bb641ebcf47707b657cc53d56","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","title":"已完成的基准运行","number":2},"sectionTitle":"已完成的基准运行","currentQuestion":"已完成的基准运行","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-1fbffe56dd364088437265c6","nextBlock":"b-39733f38869e1cf13006d5ca","prerequisites":[{"id":"b-1fbffe56dd364088437265c6","url":"#b-1fbffe56dd364088437265c6","role":"section-title"}],"relatedBlocks":[]},{"id":"b-39733f38869e1cf13006d5ca","type":"pre","scope":"block-781073c3fc214fd6b23ae0a54a479e1d","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-39733f38869e1cf13006d5ca","content":"```\nsource-trained weights stable/spurious/bias [1.009, 2.7, 0.0]\n{'source_holdout': 1.0, 'target_zero_shot': 0.076171875, 'target_adapt32': 0.9921875, 'target_scratch32': 1.0}\nadaptation gain over zero-shot 0.916 transfer advantage vs scratch -0.0078\ntest seeds 221/223 never used by optimizer; adaptation seed222 only\n\n```","sha256":"35518f6cfbb15b5a82699b09e2c8f3927ae63badfe6c426c38ccadf53baa1054","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","title":"已完成的基准运行","number":2},"sectionTitle":"已完成的基准运行","currentQuestion":"已完成的基准运行","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-f2f09ea0a844a63cd4703c7b","nextBlock":"b-990548bbe9ecc3202679d08a","prerequisites":[{"id":"b-1fbffe56dd364088437265c6","url":"#b-1fbffe56dd364088437265c6","role":"section-title"},{"id":"b-f2f09ea0a844a63cd4703c7b","url":"#b-f2f09ea0a844a63cd4703c7b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-990548bbe9ecc3202679d08a","type":"p","scope":"block-781073c3fc214fd6b23ae0a54a479e1d","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-990548bbe9ecc3202679d08a","content":"目标域零样本下降来自我们显式翻转的相关线索；这不是对现实部署原因的自动诊断。适配收益与迁移相对从零的收益不同，结果表分别报告两者。只把adapt样本数32改为8，重新生成相同环境的独立训练样本，观察方差；多种子评价时保留预先固定的测试种子，不挑最好一次。若背景在所有训练环境都相同方向相关，仅凭随机划分无法知道哪维稳定；增加环境多样性与领域知识是不同干预。[WILDS](https://wilds.stanford.edu/)提供真实分布变化基准；本例是自制可控反例。","sha256":"8cc3d72ee3e45b95d7d873936acad4fa2a00258d3a865a05c0f27ac2aa843c6b","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-781073c3fc214fd6b23ae0a54a479e1d","title":"已完成的基准运行","number":2},"sectionTitle":"已完成的基准运行","currentQuestion":"已完成的基准运行","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-39733f38869e1cf13006d5ca","nextBlock":null,"prerequisites":[{"id":"b-1fbffe56dd364088437265c6","url":"#b-1fbffe56dd364088437265c6","role":"section-title"},{"id":"b-f2f09ea0a844a63cd4703c7b","url":"#b-f2f09ea0a844a63cd4703c7b","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-37d59f020b88f451d3275386","type":"h2","scope":"block-b8f620816c50450aa37772c7ee9ebfb1","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-37d59f020b88f451d3275386","content":"## 旧版热身（历史参考）","sha256":"22776016622c2addaf705c770c88971c82973c938ae33e183a9feb3b49e49de1","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","title":"旧版热身（历史参考）","number":3},"sectionTitle":"旧版热身（历史参考）","currentQuestion":"旧版热身（历史参考）","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-ae63b18da5a6adff8e1cc2da","prerequisites":[{"id":"b-ae63b18da5a6adff8e1cc2da","url":"#b-ae63b18da5a6adff8e1cc2da","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-ae63b18da5a6adff8e1cc2da","type":"p","scope":"block-b8f620816c50450aa37772c7ee9ebfb1","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-ae63b18da5a6adff8e1cc2da","content":"旧版热身仅保留为历史参考，不参与当前基准运行；当前解释与计算以上方完整实验为准。","sha256":"e5c542ac9eaa3e8830cbf8ff2616dedc089473c3d44be23349ecd3d049b6d0f9","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","title":"旧版热身（历史参考）","number":3},"sectionTitle":"旧版热身（历史参考）","currentQuestion":"旧版热身（历史参考）","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-37d59f020b88f451d3275386","nextBlock":"b-d0468b7e5ce6d10747a09cc6","prerequisites":[{"id":"b-37d59f020b88f451d3275386","url":"#b-37d59f020b88f451d3275386","role":"section-title"}],"relatedBlocks":[]},{"id":"b-d0468b7e5ce6d10747a09cc6","type":"h4","scope":"block-b8f620816c50450aa37772c7ee9ebfb1","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-d0468b7e5ce6d10747a09cc6","content":"#### 展开查看旧版代码（仅展示，不执行）","sha256":"b5f2d755e2ad018e90a28a20600c873333e0691cce1a7f018f374a7d482cbaf3","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","title":"旧版热身（历史参考）","number":3},"sectionTitle":"旧版热身（历史参考）","currentQuestion":"旧版热身（历史参考）","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-ae63b18da5a6adff8e1cc2da","nextBlock":"b-8723ee644104f6ca83e2ba1f","prerequisites":[{"id":"b-37d59f020b88f451d3275386","url":"#b-37d59f020b88f451d3275386","role":"section-title"},{"id":"b-ae63b18da5a6adff8e1cc2da","url":"#b-ae63b18da5a6adff8e1cc2da","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-8723ee644104f6ca83e2ba1f","type":"pre","scope":"block-b8f620816c50450aa37772c7ee9ebfb1","url":"https://codingai-lec03.pages.dev/course/notebooks/c20ef6a65d184331b1b52bf351077504.html#b-8723ee644104f6ca83e2ba1f","content":"```\ntrain=[('grass','cow')]*8+[('water','duck')]*8; test=[('water','cow')]*4+[('grass','duck')]*4\ndef bg_rule(bg):return 'cow' if bg=='grass' else 'duck'\nprint('train acc',sum(bg_rule(x)==y for x,y in train)/len(train)); print('environment-shift acc',sum(bg_rule(x)==y for x,y in test)/len(test))\n\n```","sha256":"c96c8bb83ebcc08766fb28408f8fb954ca4776be883cbd3d4947d0e4f2c839cb","chapter":{"id":"I","title":"学习信号与表示"},"unit":{"id":"i-use-and-evaluate","title":"怎样判断表示支持了哪种使用方式？"},"page":{"id":"reading-block-b8f620816c50450aa37772c7ee9ebfb1","title":"旧版热身（历史参考）","number":3},"sectionTitle":"旧版热身（历史参考）","currentQuestion":"旧版热身（历史参考）","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-d0468b7e5ce6d10747a09cc6","nextBlock":null,"prerequisites":[{"id":"b-d0468b7e5ce6d10747a09cc6","url":"#b-d0468b7e5ce6d10747a09cc6","role":"section-title"},{"id":"b-ae63b18da5a6adff8e1cc2da","url":"#b-ae63b18da5a6adff8e1cc2da","role":"problem-context"}],"relatedBlocks":[]}]}
