Skip to content

🌐 [translation-sync] Update all lectures to use latest guide of jax random key creation - #247

Open
mmcky wants to merge 30 commits into
mainfrom
translation-sync-2026-08-12T07-04-14-pr-965
Open

🌐 [translation-sync] Update all lectures to use latest guide of jax random key creation#247
mmcky wants to merge 30 commits into
mainfrom
translation-sync-2026-08-12T07-04-14-pr-965

Conversation

@mmcky

@mmcky mmcky commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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.yml
  • ✏️ lectures/ar1_bayes.md
  • ✏️ .translate/state/ar1_bayes.md.yml
  • ✏️ lectures/back_prop.md
  • ✏️ .translate/state/back_prop.md.yml
  • ✏️ lectures/ifp_advanced.md
  • ✏️ .translate/state/ifp_advanced.md.yml
  • ✏️ lectures/ifp_egm.md
  • ✏️ .translate/state/ifp_egm.md.yml
  • ✏️ lectures/ifp_egm_transient_shocks.md
  • ✏️ .translate/state/ifp_egm_transient_shocks.md.yml
  • ✏️ lectures/lake_model.md
  • ✏️ .translate/state/lake_model.md.yml
  • ✏️ lectures/mccall_fitted_vfi.md
  • ✏️ .translate/state/mccall_fitted_vfi.md.yml
  • ✏️ lectures/mccall_model.md
  • ✏️ .translate/state/mccall_model.md.yml
  • ✏️ lectures/mccall_model_with_sep_markov.md
  • ✏️ .translate/state/mccall_model_with_sep_markov.md.yml
  • ✏️ lectures/mccall_persist_trans.md
  • ✏️ .translate/state/mccall_persist_trans.md.yml
  • ✏️ lectures/newton_method.md
  • ✏️ .translate/state/newton_method.md.yml
  • ✏️ lectures/os_egm_jax.md
  • ✏️ .translate/state/os_egm_jax.md.yml
  • ✏️ lectures/unemployment_linear.md
  • ✏️ .translate/state/unemployment_linear.md.yml
  • ✏️ lectures/unemployment_shocks.md
  • ✏️ .translate/state/unemployment_shocks.md.yml

Details

  • Source Language: en
  • Target Language: zh-cn
  • Model: claude-sonnet-5

This PR was created automatically by the translation action.

mmcky added 30 commits August 12, 2026 17:04
Copilot AI lite review requested due to automatic review settings August 12, 2026 07:04
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation labels Aug 12, 2026
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 626aac6
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a7c1b09ae2e0f0008f13e56
😎 Deploy Preview https://deploy-preview-247--astonishing-narwhal-a8fc64.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-5 | Date: 2026-08-12
Routing: editor — 4 minor finding(s) in gating categories (accuracy/terminology/syntax/diff-check/other); accuracy 8 below floor 9; terminology 8 below floor 9
Shadow gate: would NOT auto-merge (recorded only; no action taken)


📝 Translation Quality

Criterion Score
Accuracy 8/10
Fluency 8/10
Terminology 8/10
Formatting 8/10
Overall 8/10

Summary: 整体翻译质量很高,准确传达了原文的经济学和数值计算概念,专业术语基本遵循了参考术语表,格式和MyST语法保持完整无误。存在少量术语一致性上的小问题(如'离职率'与'分离率'混用),以及个别句子可以更加口语化以提升流畅度,但这些都是轻微问题,不影响整体理解和技术准确性。未发现任何阻断性错误或语法破坏问题。 数学公式、代码块和LaTeX表达式在所有翻译文件中均完整保留,未出现格式破坏 专业术语翻译总体准确,如'内生网格法'、'贝尔曼方程'、'欧拉方程'、'保留工资'等经济学和数值方法术语翻译规范且前后一致 中文标点符号使用规范,全角标点(,。:!?)应用正确 MyST指令(如{doc}、{cite}、{eq})与中文文本间的空格处理符合语言特定翻译政策要求 长段落的技术性内容(如牛顿法推导、EGM算法步骤)翻译清晰,逻辑结构与原文保持一致,专业性强

Suggestions:

  • [minor · terminology] lectures/aiyagari_egm.md — ## 概述: 'stationary rational expectations equilibrium (SREE)' 被翻译为'平稳理性预期均衡(SREE)',虽然可以接受,但在整个术语表中未见此专有名词的既定译法,建议保持一致性检查(此处翻译本身没有明显问题,属轻微观察)。
  • [minor · accuracy] lectures/aiyagari_egm.md — ## Wealth Distribution -> ## 财富分布: 英文原文标题为'Wealth Distribution',但PR变更列表中并未包含此标题,中文翻译中却将其列为已翻译章节标题;由于该章节实际不在变更范围内(原文档中此标题未标记为MODIFIED),根据规则应忽略,但仍标注供参考。
  • [minor · terminology] lectures/mccall_model_with_sep_markov.md — ## 模型设置: 'job separation' 在术语表中常译为'离职'或'分离',此文档中使用了'分离率'(separation rate)与'离职率'混用(如“工作每期以概率$\alpha$终止(分离率)”与其他地方的“离职率”),建议统一为'离职率'以保持全文一致性。 → 统一使用'离职率'代替'分离率'
  • [minor · terminology] lectures/unemployment_linear.md — ## 自然率与滞后效应: 'hysteresis hypothesis' 翻译为'滞后效应假说',这是可接受的翻译,但更常见学术译法为'滞后效应假说'或'磁滞假说',建议在术语表中确认统一译法(此为观察项,非严重问题)。
  • [nit · fluency] lectures/ar1_bayes.md — ### PyMC实现: 部分句子如“这内在地保证了平稳性”读起来略显生硬,可以更口语化,如“这从内在上保证了平稳性”或“这自然地保证了平稳性”。 → 这自然地保证了平稳性

🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 10/10

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with jax.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/*.yml sync 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.key in 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.

Comment thread lectures/back_prop.md
Comment on lines 487 to 491
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]):
Comment thread lectures/mccall_model.md
Comment on lines 939 to 943
参数:
-----------
key : jax.random.PRNGKey
key : jax.random.key
JAX 的随机密钥
model : McCallModelContinuous
Comment thread lectures/ar1_bayes.md
Comment on lines 397 to +402
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')
@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 12, 2026 07:25 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants