知识卡片

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

随机种子与环境共同复现

理解等级:中级

固定种子有助重现随机流程;对每个候选设置独立可记录种子,还便于单独重跑某轮。设备、算子和库版本变化仍可能改变结果;若每轮重复同一种子和同一状态,又可能生成相同候选而失去多样性。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Furthermore, in the code above, we set the random seed for each round individually: if seed is not None: torch.manual_seed(seed + i + 1) Technically, this is not necessary and seeing the random seed once should be sufficient to generate diverse samples. However, this explicit seeding is useful if we want to individually rerun some of the rounds. Let's try out this function in practice

    参考来源

    - 位置:《Build a Reasoning Model (From Scratch)》第04章《推理时计算扩展》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Build a Reasoning Model (From Scratch)/_epub-src/OEBPS/Text/chapter-4.html) - 结论依据:摘录中关于随机种子与环境共同复现的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Furthermore, in the code above, we set the random seed for each round individually: if seed is not None: torch.manual_seed(seed + i + 1) Technically, this is not necessary and seeing the random seed once should be sufficient to generate diverse samples. However, this explicit seeding is useful if we want to individually rerun some of the rounds. Let's try out this function in practice