{"version":2,"relationshipURLBase":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html","relationshipResolution":"Resolve relative relationship URLs against relationshipURLBase; complete records and absolute URLs are in blocks.","title":"1. 环境与有限问题接口 · 实现代码","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html","markdown":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.md","pages":[{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","unit":"1. 环境与有限问题接口 · 实现代码","unitId":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","chapter":"course","number":1}],"aliases":[{"oldId":"b-413834a19e7ed296c6396721","targetId":"b-413834a19e7ed296c6396721","page":"reading-opening","operation":"move","beforeSHA256":"926fc2429c1a5c837765e5152b3b61fda31c10537785a439d49dec46e82a8536","afterSHA256":"926fc2429c1a5c837765e5152b3b61fda31c10537785a439d49dec46e82a8536","reason":"Same source body in authored semantic page"},{"oldId":"b-d07e814c25e4bed8a03e1634","targetId":"b-d07e814c25e4bed8a03e1634","page":"reading-opening","operation":"move","beforeSHA256":"3365a366309ecde0e8d6a8abd833283b6718ebeb56b7fe9c863fb6ec50feff22","afterSHA256":"3365a366309ecde0e8d6a8abd833283b6718ebeb56b7fe9c863fb6ec50feff22","reason":"Same source body in authored semantic page"},{"oldId":"b-8558b0b173369da92875cb11","targetId":"b-8558b0b173369da92875cb11","page":"reading-opening","operation":"move","beforeSHA256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","afterSHA256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","reason":"Same source body in authored semantic page"},{"oldId":"b-97451d2b97bcd063e6ace3b2","targetId":"b-97451d2b97bcd063e6ace3b2","page":"reading-opening","operation":"move","beforeSHA256":"5790b0afb52508f0174b1bc581f7847035a51c5c2a46e5c821bcd9d5d61bcbb0","afterSHA256":"5790b0afb52508f0174b1bc581f7847035a51c5c2a46e5c821bcd9d5d61bcbb0","reason":"Same source body in authored semantic page"},{"oldId":"b-68c1df80c2472f76f68edea1","targetId":"b-68c1df80c2472f76f68edea1","page":"reading-opening","operation":"move","beforeSHA256":"810908fd69927093502edf9303e0f30160207a520fff2e154f31763f77c1dc30","afterSHA256":"810908fd69927093502edf9303e0f30160207a520fff2e154f31763f77c1dc30","reason":"Same source body in authored semantic page"}],"blocks":[{"id":"b-413834a19e7ed296c6396721","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html#b-413834a19e7ed296c6396721","content":"[LAB 14 · 图像问答：视觉条件与问题先验](/course/notebooks/11d9f74871544a77b42024a9fe06b81a.html)","sha256":"926fc2429c1a5c837765e5152b3b61fda31c10537785a439d49dec46e82a8536","chapter":{"id":"course","title":"1. 环境与有限问题接口 · 实现代码"},"unit":{"id":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","title":"1. 环境与有限问题接口 · 实现代码"},"page":{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","number":1},"sectionTitle":"1. 环境与有限问题接口 · 实现代码","currentQuestion":"1. 环境与有限问题接口 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":null,"nextBlock":"b-d07e814c25e4bed8a03e1634","prerequisites":[],"relatedBlocks":[]},{"id":"b-d07e814c25e4bed8a03e1634","type":"h1","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html#b-d07e814c25e4bed8a03e1634","content":"# 1. 环境与有限问题接口 · 实现代码","sha256":"3365a366309ecde0e8d6a8abd833283b6718ebeb56b7fe9c863fb6ec50feff22","chapter":{"id":"course","title":"1. 环境与有限问题接口 · 实现代码"},"unit":{"id":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","title":"1. 环境与有限问题接口 · 实现代码"},"page":{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","number":1},"sectionTitle":"1. 环境与有限问题接口 · 实现代码","currentQuestion":"1. 环境与有限问题接口 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-413834a19e7ed296c6396721","nextBlock":"b-8558b0b173369da92875cb11","prerequisites":[{"id":"b-413834a19e7ed296c6396721","url":"#b-413834a19e7ed296c6396721","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-8558b0b173369da92875cb11","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html#b-8558b0b173369da92875cb11","content":"按问题继续","sha256":"e91f24e4e4ca40e2099a0d81d30db6568f4bf2074b499eeee6e3959617bd97ac","chapter":{"id":"course","title":"1. 环境与有限问题接口 · 实现代码"},"unit":{"id":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","title":"1. 环境与有限问题接口 · 实现代码"},"page":{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","number":1},"sectionTitle":"1. 环境与有限问题接口 · 实现代码","currentQuestion":"1. 环境与有限问题接口 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-d07e814c25e4bed8a03e1634","nextBlock":"b-97451d2b97bcd063e6ace3b2","prerequisites":[{"id":"b-d07e814c25e4bed8a03e1634","url":"#b-d07e814c25e4bed8a03e1634","role":"section-title"},{"id":"b-413834a19e7ed296c6396721","url":"#b-413834a19e7ed296c6396721","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-97451d2b97bcd063e6ace3b2","type":"p","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html#b-97451d2b97bcd063e6ace3b2","content":"RGB+问题输入、question-only对照、同图换问与同问换图","sha256":"5790b0afb52508f0174b1bc581f7847035a51c5c2a46e5c821bcd9d5d61bcbb0","chapter":{"id":"course","title":"1. 环境与有限问题接口 · 实现代码"},"unit":{"id":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","title":"1. 环境与有限问题接口 · 实现代码"},"page":{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","number":1},"sectionTitle":"1. 环境与有限问题接口 · 实现代码","currentQuestion":"1. 环境与有限问题接口 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-8558b0b173369da92875cb11","nextBlock":"b-68c1df80c2472f76f68edea1","prerequisites":[{"id":"b-d07e814c25e4bed8a03e1634","url":"#b-d07e814c25e4bed8a03e1634","role":"section-title"},{"id":"b-413834a19e7ed296c6396721","url":"#b-413834a19e7ed296c6396721","role":"problem-context"}],"relatedBlocks":[]},{"id":"b-68c1df80c2472f76f68edea1","type":"pre","scope":"document","url":"https://codingai-lec03.pages.dev/course/notebook-blocks/924df89109464fed8b7817f3ebf2b233.html#b-68c1df80c2472f76f68edea1","content":"```\nfrom pathlib import Path\nimport json, hashlib, platform, sys, time\nfrom datetime import datetime, timezone\nimport numpy as np\nfrom PIL import Image, ImageDraw\nimport matplotlib\nif 'get_ipython' not in globals(): matplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nOUT=Path('outputs/lab14');OUT.mkdir(parents=True,exist_ok=True)\ntorch.set_num_threads(1);torch.manual_seed(1403);np.random.seed(1403);START=time.perf_counter()\nCOLORS={'red':(220,55,55),'blue':(45,95,225),'green':(35,170,75)}\nQUESTIONS=['how many objects?','what color is the leftmost object?','what shape is the rightmost object?']\nANSWERS=['one','two','red','blue','green','square','circle']; A={x:i for i,x in enumerate(ANSWERS)}\nprint('CPU',torch.__version__,'seed 1403; answer vocabulary:',ANSWERS)\n```","sha256":"810908fd69927093502edf9303e0f30160207a520fff2e154f31763f77c1dc30","chapter":{"id":"course","title":"1. 环境与有限问题接口 · 实现代码"},"unit":{"id":"notebook-blocks/924df89109464fed8b7817f3ebf2b233","title":"1. 环境与有限问题接口 · 实现代码"},"page":{"id":"reading-opening","title":"1. 环境与有限问题接口 · 实现代码","number":1},"sectionTitle":"1. 环境与有限问题接口 · 实现代码","currentQuestion":"1. 环境与有限问题接口 · 实现代码","sourceSlides":[],"knowledgeBlock":null,"formulas":[],"previousBlock":"b-97451d2b97bcd063e6ace3b2","nextBlock":null,"prerequisites":[{"id":"b-d07e814c25e4bed8a03e1634","url":"#b-d07e814c25e4bed8a03e1634","role":"section-title"},{"id":"b-413834a19e7ed296c6396721","url":"#b-413834a19e7ed296c6396721","role":"problem-context"}],"relatedBlocks":[]}]}
