🌐 [translation-sync] Update all lectures to use latest guide of jax random key creation - #247
🌐 [translation-sync] Update all lectures to use latest guide of jax random key creation#247mmcky wants to merge 30 commits into
Conversation
✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-12 📝 Translation Quality
Summary: 整体翻译质量很高,准确传达了原文的经济学和数值计算概念,专业术语基本遵循了参考术语表,格式和MyST语法保持完整无误。存在少量术语一致性上的小问题(如'离职率'与'分离率'混用),以及个别句子可以更加口语化以提升流畅度,但这些都是轻微问题,不影响整体理解和技术准确性。未发现任何阻断性错误或语法破坏问题。 数学公式、代码块和LaTeX表达式在所有翻译文件中均完整保留,未出现格式破坏 专业术语翻译总体准确,如'内生网格法'、'贝尔曼方程'、'欧拉方程'、'保留工资'等经济学和数值方法术语翻译规范且前后一致 中文标点符号使用规范,全角标点(,。:!?)应用正确 MyST指令(如{doc}、{cite}、{eq})与中文文本间的空格处理符合语言特定翻译政策要求 长段落的技术性内容(如牛顿法推导、EGM算法步骤)翻译清晰,逻辑结构与原文保持一致,专业性强 Suggestions:
🔍 Diff Quality
Summary: The translation sync correctly applied JAX API updates (PRNGKey to key) and i18n font import additions across all 15 modified files, matching the source document's changes in scope and position. This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
This automated translation-sync PR updates the zh-cn lecture content to match upstream changes, primarily modernizing JAX random key creation in code examples and refreshing translation state metadata.
Changes:
- Replaced
jax.random.PRNGKey(...)/random.PRNGKey(...)usages withjax.random.key(...)/random.key(...)across affected lectures. - Updated some notebook/lecture metadata (e.g.,
jupytext_version, kernelspec display name) and cleaned up extra blank lines / code-fence formatting. - Updated
.translate/state/*.ymlsync metadata to reflect the new source SHA, model, and tool version.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lectures/aiyagari_egm.md | Update JAX key creation in examples; minor formatting cleanup. |
| .translate/state/aiyagari_egm.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/ar1_bayes.md | Update JAX key creation; includes plot label text changes. |
| .translate/state/ar1_bayes.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/back_prop.md | Update JAX key creation in training example; metadata updates. |
| .translate/state/back_prop.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/ifp_advanced.md | Update JAX key creation in simulation helpers. |
| .translate/state/ifp_advanced.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/ifp_egm.md | Add notebook header raw block; update JAX key creation. |
| .translate/state/ifp_egm.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/ifp_egm_transient_shocks.md | Update JAX key creation; formatting cleanup. |
| .translate/state/ifp_egm_transient_shocks.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/lake_model.md | Update JAX key creation; metadata updates. |
| .translate/state/lake_model.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/mccall_fitted_vfi.md | Update JAX key creation; metadata updates. |
| .translate/state/mccall_fitted_vfi.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/mccall_model.md | Update JAX key creation and related docstrings; metadata updates. |
| .translate/state/mccall_model.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/mccall_model_with_sep_markov.md | Update JAX key creation; formatting cleanup. |
| .translate/state/mccall_model_with_sep_markov.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/mccall_persist_trans.md | Update JAX key creation; add jupytext metadata fields. |
| .translate/state/mccall_persist_trans.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/newton_method.md | Update JAX key creation in linear algebra example. |
| .translate/state/newton_method.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/os_egm_jax.md | Update JAX key creation in model setup example. |
| .translate/state/os_egm_jax.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/unemployment_linear.md | Update JAX key creation in NumPyro MCMC helper; formatting cleanup. |
| .translate/state/unemployment_linear.md.yml | Translation sync metadata update (source SHA/model/tool version). |
| lectures/unemployment_shocks.md | Update JAX key creation in NumPyro MCMC helper; formatting cleanup. |
| .translate/state/unemployment_shocks.md.yml | Translation sync metadata update (source SHA/model/tool version). |
Suppressed comments (1)
lectures/mccall_model.md:1062
- Same as above:
key : jax.random.keyin the docstring is not a valid type (it's a function). Use a key array / KeyArray type description instead.
-----------
w_bar : float
保留工资
key : jax.random.key
JAX 的随机密钥
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def train(params, grid, f_val, key, num_epochs=300): | ||
| for epoch in range(num_epochs): | ||
| key, _ = random.split(key) | ||
| random_permutation = random.permutation(random.PRNGKey(1), indices) | ||
| random_permutation = random.permutation(random.key(1), indices) | ||
| for x, y in zip(grid[random_permutation], f_val[random_permutation]): |
| 参数: | ||
| ----------- | ||
| key : jax.random.PRNGKey | ||
| key : jax.random.key | ||
| JAX 的随机密钥 | ||
| model : McCallModelContinuous |
| fig, ax = plt.subplots() | ||
| ax.hist(ρ_cond, bins=50, density=True, alpha=0.5, | ||
| label='条件化假设') | ||
| label='conditioning assumption') | ||
| ax.hist(ρ_stat, bins=50, density=True, alpha=0.5, | ||
| label='平稳性假设') | ||
| ax.axvline(ρ_true, color='k', linestyle='--', lw=2, label='真实值') | ||
| label='stationary assumption') | ||
| ax.axvline(ρ_true, color='k', linestyle='--', lw=2, label='true value') |
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python.myst.
Source PR
#965 - Update all lectures to use latest guide of jax random key creation
Files Updated
lectures/aiyagari_egm.md.translate/state/aiyagari_egm.md.ymllectures/ar1_bayes.md.translate/state/ar1_bayes.md.ymllectures/back_prop.md.translate/state/back_prop.md.ymllectures/ifp_advanced.md.translate/state/ifp_advanced.md.ymllectures/ifp_egm.md.translate/state/ifp_egm.md.ymllectures/ifp_egm_transient_shocks.md.translate/state/ifp_egm_transient_shocks.md.ymllectures/lake_model.md.translate/state/lake_model.md.ymllectures/mccall_fitted_vfi.md.translate/state/mccall_fitted_vfi.md.ymllectures/mccall_model.md.translate/state/mccall_model.md.ymllectures/mccall_model_with_sep_markov.md.translate/state/mccall_model_with_sep_markov.md.ymllectures/mccall_persist_trans.md.translate/state/mccall_persist_trans.md.ymllectures/newton_method.md.translate/state/newton_method.md.ymllectures/os_egm_jax.md.translate/state/os_egm_jax.md.ymllectures/unemployment_linear.md.translate/state/unemployment_linear.md.ymllectures/unemployment_shocks.md.translate/state/unemployment_shocks.md.ymlDetails
This PR was created automatically by the translation action.