Skip to content

🌐 [translation-sync] Update all lectures to use latest guide of jax random (recovery of #247) - #256

Merged
mmcky merged 31 commits into
mainfrom
translation-sync-2026-08-12T07-04-14-pr-965
Aug 19, 2026
Merged

🌐 [translation-sync] Update all lectures to use latest guide of jax random (recovery of #247)#256
mmcky merged 31 commits into
mainfrom
translation-sync-2026-08-12T07-04-14-pr-965

Conversation

@mmcky

@mmcky mmcky commented Aug 19, 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.


Recovery note: this PR recovers #247, auto-closed by the rebase force-push race on 2026-08-18 23:27:11Z (see the correction comment on #240 for the event-log analysis). Same branch; body restored verbatim from #247 so review mode can locate the Source PR reference.

mmcky added 30 commits August 19, 2026 09:27
Copilot AI lite review requested due to automatic review settings August 19, 2026 00:39
@netlify

netlify Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploy Preview for astonishing-narwhal-a8fc64 ready!

Name Link
🔨 Latest commit 7907026
🔍 Latest deploy log https://app.netlify.com/projects/astonishing-narwhal-a8fc64/deploys/6a84fb69d4295c00089c7ee4
😎 Deploy Preview https://deploy-preview-256--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.

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 PR updates the zh-cn lecture sources to align with the latest JAX guidance for random key creation, syncing the translated lectures with the upstream QuantEcon source update (recovery of the previously closed sync PR).

Changes:

  • Updated JAX / NumPyro examples to use jax.random.key(seed) / random.key(seed) instead of PRNGKey(...).
  • Refreshed notebook / MyST markdown scaffolding (e.g., jupytext metadata, minor layout/blank-line normalization, notebook header injection in one lecture).
  • Updated translation-sync state YAML files to reflect the new upstream 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 Switches key creation in JAX examples to jax.random.key and minor formatting sync.
lectures/ar1_bayes.md Updates NumPyro RNG key creation; also includes figure label text changes.
lectures/back_prop.md Updates JAX key creation in NN example code cells and formatting sync.
lectures/ifp_advanced.md Updates key creation in JAX simulation code.
lectures/ifp_egm.md Adds notebook header raw block; updates key creation in simulation code.
lectures/ifp_egm_transient_shocks.md Updates key creation in JAX implementation sections and formatting sync.
lectures/lake_model.md Updates jupytext metadata and key creation for Markov simulation.
lectures/mccall_fitted_vfi.md Updates jupytext metadata and key creation in Monte Carlo / simulation helpers.
lectures/mccall_model.md Updates jupytext metadata; updates key creation; updates docstrings referencing key type.
lectures/mccall_model_with_sep_markov.md Updates key creation in simulation helpers and formatting sync.
lectures/mccall_persist_trans.md Updates jupytext metadata and default key creation in helpers.
lectures/newton_method.md Updates JAX key creation in high-dimensional example.
lectures/os_egm_jax.md Updates JAX key creation for reproducible shock draws.
lectures/unemployment_linear.md Updates NumPyro MCMC run key creation and formatting sync.
lectures/unemployment_shocks.md Updates NumPyro MCMC run key creation and formatting sync.
.translate/state/aiyagari_egm.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/ar1_bayes.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/back_prop.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/ifp_advanced.md.yml Updates translation sync metadata (source SHA, tool version).
.translate/state/ifp_egm.md.yml Updates translation sync metadata (source SHA, tool version, mode).
.translate/state/ifp_egm_transient_shocks.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/lake_model.md.yml Updates translation sync metadata (source SHA, tool version, mode).
.translate/state/mccall_fitted_vfi.md.yml Updates translation sync metadata (source SHA, tool version, mode).
.translate/state/mccall_model.md.yml Updates translation sync metadata (source SHA, tool version, mode).
.translate/state/mccall_model_with_sep_markov.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/mccall_persist_trans.md.yml Updates translation sync metadata (source SHA, tool version, mode).
.translate/state/newton_method.md.yml Updates translation sync metadata (source SHA, synced date, tool version).
.translate/state/os_egm_jax.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/unemployment_linear.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
.translate/state/unemployment_shocks.md.yml Updates translation sync metadata (source SHA, model, tool version, mode).
Suppressed comments (1)

lectures/mccall_model.md:1062

  • 这里把参数类型写成了 jax.random.key,但 jax.random.key 是创建 key 的函数名,不是类型名;作为文档类型标注会引起误解。建议把两处(simulate_lifetime_value 与此处)统一改成更准确的类型描述(例如 jax.Array / jax.random.KeyArray 或保持与其他讲义一致的 key 类型写法)。
    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 489 to +490
key, _ = random.split(key)
random_permutation = random.permutation(random.PRNGKey(1), indices)
random_permutation = random.permutation(random.key(1), indices)
Comment thread lectures/ar1_bayes.md
Comment on lines 398 to +402
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')
Comment thread lectures/mccall_model.md
Comment on lines +941 to 942
key : jax.random.key
JAX 的随机密钥
@mmcky mmcky added action-translation PRs created by QuantEcon/action-translation automated Automated sync PR opened by action-translation and removed action-translation PRs created by QuantEcon/action-translation labels Aug 19, 2026
@github-actions

Copy link
Copy Markdown

✅ Translation Quality Review

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


📝 Translation Quality

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

Summary: This is a high-quality translation across all 15 changed lecture files. Mathematical content, code, and MyST formatting are faithfully preserved, and domain terminology generally follows the provided glossary and reads naturally in academic Simplified Chinese. Minor issues include inconsistent translation of 'root-finding' within newton_method.md, and a few slightly literal phrasings that could be smoothed for better fluency, but none of these affect technical accuracy or document usability. Mathematical notation, LaTeX equations, and code blocks are preserved accurately across all files with no corruption or omission Technical terminology from the glossary (e.g., 贝尔曼算子, 内生网格法, 遍历性, 蒙特卡洛, 牛顿法, 雅可比矩阵) is applied consistently and correctly throughout the changed sections MyST directives, exercise/solution blocks, and code-cell structures are all correctly preserved with proper spacing between Chinese text and inline directives Complex economic and statistical concepts (e.g., leave-one-out cross-validation, EGM operator derivations, mixture model specification) are translated with accurate technical fidelity while remaining readable

Suggestions:

  • [minor · terminology] lectures/newton_method.md — 根查找 vs 零点查找 usage: The English term 'root-finding' is translated inconsistently across the document as both '求根' and '零点查找/零点寻找'. For example the heading '## Root-Finding in one dimension' becomes '一维求根' while the body text repeatedly uses '零点查找' and '零点寻找问题'. While both are understandable, picking one consistent term throughout would improve terminology consistency. → Standardize on either '求根' or '零点查找' throughout the document, e.g. use '一维求根' consistently for both heading and body references.
  • [minor · fluency] lectures/mccall_model_with_sep_markov.md — ### 求解:第一遍: The phrase '让我们组装一个(不太高效的)例程来计算保留工资' is a slightly literal translation of 'Let's put together a (not very efficient) routine'. '组装' (assemble, as in hardware) reads a bit awkwardly for code/routines; '编写' or '构建' would sound more natural in this technical context. → 让我们编写一个(不太高效的)例程来计算保留工资
  • [minor · accuracy] lectures/unemployment_shocks.md — ## 用交叉验证比较模型 / Computational methods: In the proof of prop-loo-identity, the translated proof preserves the math correctly, but the phrase '留-$i$-出的后验已经消失' is a somewhat unusual rendering of 'The leave-$i$-out posterior has vanished'. It is understandable but slightly awkward; a smoother phrasing would help readability without changing the technical meaning. → 留-i-出的后验分布已被消去,只剩下完整后验
  • [nit · fluency] lectures/ar1_bayes.md — ### Libraries / 使用的库: 'PyMC提供了成熟且可读性很高的建模语法' reads fine, but slightly more idiomatic would be to say '成熟且可读性极高的建模语法' or rephrase for smoother flow; this is a very minor stylistic point and does not affect meaning.

🔍 Diff Quality

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

Summary: Changes are minor JAX API updates (PRNGKey→key) and whitespace fixes correctly synced to translation without altering structure or headings.


This review was generated automatically by action-translation review mode.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 19, 2026 02:23 Inactive
@mmcky
mmcky merged commit 7b0a7c8 into main Aug 19, 2026
9 of 11 checks passed
@mmcky
mmcky deleted the translation-sync-2026-08-12T07-04-14-pr-965 branch August 19, 2026 02:25
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