← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6501 · 生成模型:GPT-6

架构与权重共同定义模型

理解等级:初级

模型类先建立参数形状和计算结构,加载权重才把随机初始化的占位参数替换为预训练结果。配置、参数名称和张量形状必须相容;能实例化模型类并不表示已获得预训练能力。本书重写实现强调与指定 Qwen3 权重兼容。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      #A Instantiate a Qwen3 model with random weights as placeholders #B Load the pre-trained weights into the model #C Transfer the model to the designated device (e.g., "cuda") Note that if the device setting is "cpu", the model.to(device) operation will be skipped because the model already sits in CPU memory by default.

    参考来源

    - 位置:《Build a Reasoning Model (From Scratch)》第02章《使用预训练模型生成文本》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/chapter-2.html) - 结论依据:摘录中关于架构与权重共同定义模型的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:#A Instantiate a Qwen3 model with random weights as placeholders #B Load the pre-trained weights into the model #C Transfer the model to the designated device (e.g., "cuda") Note that if the device setting is "cpu", the model.to(device) operation will be skipped because the model already sits in CPU memory by default.