🌐 [translation-sync] [mccall_q] Fix typos, heading case and figure legend - #236
🌐 [translation-sync] [mccall_q] Fix typos, heading case and figure legend#236mmcky wants to merge 2 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-05 📝 Translation Quality
Summary: This is a high-quality, faithful translation of a technically dense lecture on Q-learning applied to the McCall search model. Terminology is handled consistently and accurately, mathematical content is fully preserved, and the prose reads naturally in academic Simplified Chinese. Minor issues include a slight expansion in the Overview section and a small terminological nuance around 'gain' vs. '学习率', but these do not affect overall comprehension or correctness. Mathematical notation, equations, and code blocks are fully preserved without corruption across all changed sections Technical terms such as 时序差分学习, 贝尔曼方程, Q-表/Q-函数, ε-贪婪算法 are translated consistently and correctly throughout The translation maintains appropriate academic register and closely follows the logical structure of the original argument, including the pseudocode steps for Q-learning Suggestions:
🔍 Diff Quality
Summary: The translation sync correctly applied all heading capitalization changes, code refactoring (rng threading, cell merge, formatting fixes), and text corrections in the same relative positions as the source. This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
This PR syncs zh-cn lecture content for mccall_q from the upstream English source PR, primarily correcting headings/wording and updating some embedded code cells used in the lecture.
Changes:
- Updated the front-matter
translation.headingskeys to match the source heading case. - Adjusted several code cells (randomness handling, progress printing, plotting legend formatting) and refined one explanatory sentence.
- Updated translation-sync state metadata (
source-sha,synced-at, mode/tool-version).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lectures/mccall_q.md |
Translation heading key case updates; text tweak; code-cell changes to RNG usage and plotting/progress output. |
.translate/state/mccall_q.md.yml |
Updates sync metadata (source SHA/date/mode/tool version). |
Suppressed comments (5)
lectures/mccall_q.md:514
temp_diffis part of a Numba@jitclass; therngparameter (NumPyGenerator) is not Numba-compatible and will break compilation. Remove therngargument and rely onnp.random.*calls inside jitted code.
def temp_diff(self, qtable, state, accept, rng):
"""
计算与状态和动作相关的TD。
"""
lectures/mccall_q.md:533
run_one_epochis a Numba@jitclassmethod; taking a NumPyGeneratorparameter (rng) is not supported by Numba and will fail compilation. Drop therngparameter and calldraw_offer_index()directly.
def run_one_epoch(self, qtable, rng, max_times=20000):
"""
运行一个"轮次"。
"""
lectures/mccall_q.md:547
- Within a Numba
@jitclass, calls torng.random()and passingrngintotemp_diffare not supported (NumPyGeneratoris not a Numba type). Usenp.random.random()and calltemp_diff(...)without arngargument.
# 选择动作
accept = np.argmax(qtable[s, :])
if rng.random()<=eps:
accept = 1 - accept
lectures/mccall_q.md:573
run_epochsis decorated with@jitand calls into a Numba@jitclass. Accepting/passing a NumPyGenerator(rng) will force object-mode at best and can still fail depending on compilation. Remove therngparameter and callrun_one_epochwithout it.
@jit
def run_epochs(N, qlmc, qtable, rng):
"""
运行N次轮次,每次使用上一次迭代的qtable。
"""
lectures/mccall_q.md:670
- After removing
rngfromrun_one_epoch, this call should not passrng(otherwise it will raise aTypeError).
new_qtable = qlmc_new.run_one_epoch(qtable, rng)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| plt.rcParams['font.family'] = ['Source Han Serif SC'] | ||
|
|
||
| np.random.seed(123) | ||
| rng = np.random.default_rng(123) |
| def draw_offer_index(self, rng): | ||
| """ | ||
| 从工资分布中抽取状态索引。 | ||
| """ | ||
|
|
| # 运行 | ||
| qtable0 = np.zeros((len(w_default), 2)) | ||
| qtable = run_epochs(20000, qlmc, qtable0) | ||
| qtable = run_epochs(20000, qlmc, qtable0, rng) |
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python.myst.
Source PR
#624 - [mccall_q] Fix typos, heading case and figure legend
Files Updated
lectures/mccall_q.md.translate/state/mccall_q.md.ymlDetails
This PR was created automatically by the translation action.