🌐 [translation-sync] [mccall_q] Fix typos, heading case and figure legend - #236
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-19 📝 Translation Quality
Summary: This is a high-quality, accurate translation of a technically dense lecture on Q-learning applied to the McCall search model. Mathematical content, code, and structure are faithfully preserved, and terminology is mostly consistent with the glossary. Minor issues include a few additions of explanatory content beyond the source and a small terminology overlap between 'gain parameter' and 'learning rate' that could be clarified. No syntax errors were found in the changed sections. Mathematical notation and equation numbering are fully preserved and correctly matched to source Code blocks remain functionally intact with helpful added Chinese comments where appropriate (e.g., docstring translations) Technical concepts like Q-function, temporal difference learning, and epsilon-greedy strategy are translated clearly and consistently with appropriate glossary usage Suggestions:
🔍 Diff Quality
Summary: The heading metadata and prose changes were correctly synced, but several source code-cell modifications (progress-print logic, cell splitting, legend formatting) were not applied to the target document. Issues:
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) |
…lict by keeping the branch's newer source state (46cf999, 2026-08-05, post-dates #229's 4a5fad7)
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.