🌐 [translation-sync] Improve and simplify JAX lectures#109
🌐 [translation-sync] Improve and simplify JAX lectures#109
Conversation
✅ Deploy Preview for majestic-griffin-10b166 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-04-14 📝 Translation Quality
Summary: The translation is of high quality across all modified and added sections. Technical accuracy is strong, terminology is mostly consistent (with minor inconsistency between 'غیرخالص' and 'ناخالص' for 'impure'), and the Persian reads naturally with appropriate academic register. The new sections (Benefits, NumPy/MATLAB Approach, JAX random numbers, First/Second Attempt) are well-integrated. Minor improvements could be made to better capture nuanced terms like 'explicitness' and 'patterns', and to ensure terminology consistency for 'impure functions' throughout the document. Technical terminology is consistently and accurately translated throughout all modified sections, including correct use of 'کامپایل JIT', 'برداریسازی', 'توابع خالص', and 'مولد اعداد تصادفی'. The YAML frontmatter translation metadata is correctly structured with proper hierarchical heading mappings using the double-colon notation for all new and modified sections. Mathematical notation and LaTeX expressions are fully preserved without modification across all changed sections. The added sections (### NumPy / MATLAB Approach, ### JAX, ### Benefits, #### First Attempt, #### Second Attempt) are well-translated with natural Persian phrasing that maintains the academic register of the source. Code comments and inline technical terms (like Suggestions:
🔍 Diff Quality
Summary: Both files are correctly modified with changes in the right positions and the heading maps accurately reflect the restructured sections in both documents. This review was generated automatically by action-translation review mode. |
✅ Translation Quality ReviewVerdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-04-14 📝 Translation Quality
Summary: The translation of the changed sections is of high quality, accurately conveying technical content about JAX random numbers, JIT compilation, and sequential operations. The newly added sections (NumPy/MATLAB Approach, JAX, Benefits, First/Second Attempt) are well-integrated and read naturally. Minor issues include a few omitted words ('still', 'همچنان'), a slightly unnatural noun phrase for 'explicitness', and minor fluency improvements possible in the Summary section. No syntax errors were found. Overall, the translation is reliable and suitable for publication. Technical terminology is consistently and correctly applied throughout the changed sections, including proper translation of JIT compilation concepts, random number generation, and vmap vectorization The newly added sections (### NumPy / MATLAB Approach, ### JAX, ### Benefits, #### First Attempt, #### Second Attempt) are well-translated with natural Persian phrasing and accurate content Mathematical and code formatting is fully preserved across all modified sections, with LaTeX equations and code blocks intact The translation of the 'Benefits' section correctly uses established glossary terms like 'تکرارپذیری' (Reproducibility) and 'موازیسازی' (Parallelization) The YAML frontmatter translation metadata is correctly structured with proper heading mappings for all new and modified sections Suggestions:
🔍 Diff Quality
Summary: All translation sync changes are correctly applied: the same files are modified, restructured sections appear in the correct positions, document structure is preserved, and the heading map is properly updated with new/removed headings and their Persian translations. This review was generated automatically by action-translation review mode. |
There was a problem hiding this comment.
Pull request overview
Automated translation sync (en → fa) incorporating upstream improvements that simplify and restructure the JAX-related lecture content.
Changes:
- Updated Persian lecture content in
jax_intro.md(notably the random numbers section structure and explanations, plus some JIT/vmap narrative edits). - Updated Persian lecture content in
numpy_vs_numba_vs_jax.md(vectorization and sequential-ops sections refined; added “First/Second Attempt” subsections for JAX sequential ops). - Refreshed translation sync state files with the new source SHA and sync timestamp.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| lectures/numpy_vs_numba_vs_jax.md | Syncs updated explanations and structure for NumPy/Numba/JAX comparisons; adds new subsections and refactors some code/narration. |
| lectures/jax_intro.md | Syncs updated random-number-state explanation structure and related narrative adjustments in the JAX intro lecture. |
| .translate/state/numpy_vs_numba_vs_jax.md.yml | Updates the stored source SHA and sync date for the translation state. |
| .translate/state/jax_intro.md.yml | Updates the stored source SHA and sync date for the translation state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| در نسخه برداری شده، تمام حلقهها در کد کامپایل شده انجام میشوند. | ||
|
|
||
| علاوه بر این، NumPy از چندنخی ضمنی استفاده میکند، به طوری که حداقل مقداری موازیسازی رخ میدهد. | ||
| استفاده از `meshgrid` به ما امکان میدهد حلقه for تودرتو را تکرار کنیم. |
There was a problem hiding this comment.
جمله «استفاده از meshgrid به ما امکان میدهد حلقه for تودرتو را تکرار کنیم» از نظر معنایی نادرست/گمراهکننده است؛ meshgrid و برداریسازی هدفشان حذف/جایگزینی حلقههای تودرتو با عملیات آرایهای است، نه «تکرار» آنها. پیشنهاد: بازنویسی جمله به شکلی که صریحاً به حذف حلقهها و اجرای محاسبات در کد برداری/کامپایلشده اشاره کند.
| استفاده از `meshgrid` به ما امکان میدهد حلقه for تودرتو را تکرار کنیم. | |
| استفاده از `meshgrid` به ما امکان میدهد بهجای نوشتن حلقههای `for` تودرتوی صریح، محاسبه را روی کل آرایهها بهصورت برداری انجام دهیم. |
| # Large grid | ||
| grid = np.linspace(-3, 3, 3_000) | ||
| x, y = np.meshgrid(grid, grid) | ||
|
|
||
| x, y = np.meshgrid(grid, grid) # MATLAB style meshgrid | ||
|
|
There was a problem hiding this comment.
در این بخش متن فارسی است اما کامنتهای جدید داخل کد (# Large grid و # MATLAB style meshgrid) انگلیسی هستند. برای یکدستی نسخهٔ فارسی، بهتر است این کامنتها ترجمه شوند یا حذف شوند (بهخصوص چون توضیح فارسی در متن اطراف وجود دارد).
| # Construct a function that takes the max over all x for given y | ||
| f_vec_x_max = lambda y: jnp.max(f(grid, y)) | ||
| # تابع را برداری کنید تا بتوانیم روی تمام سطرها همزمان فراخوانی کنیم | ||
| # Vectorize the function so we can call on all y simultaneously | ||
| f_vec_max = jax.vmap(f_vec_x_max) |
There was a problem hiding this comment.
کامنتهای داخل تابع compute_max_vmap به انگلیسی اضافه شدهاند. با توجه به اینکه این یک سخنرانی ترجمهشده به فارسی است، بهتر است این توضیحات هم فارسی شوند (یا اگر ضروری نیستند، حذف شوند) تا خواننده مجبور به سوئیچ زبانی داخل همان بلوک کد نشود.
| with qe.Timer(): | ||
| z_max = compute_max_vmap(grid).block_until_ready() | ||
| # First run | ||
| z_max = compute_max_vmap(grid) | ||
| # Hold interpreter | ||
| z_max.block_until_ready() |
There was a problem hiding this comment.
کامنت «Hold interpreter» در این سلول هم انگلیسی است و هم از نظر معنا دقیق نیست. هدف این خط block_until_ready() این است که اجرای ناهمگام روی دستگاه تمام شود تا زمانسنجی درست باشد. پیشنهاد: کامنت را به چیزی مثل «منتظر بمان تا محاسبه روی دستگاه تمام شود (برای زمانسنجی)» تغییر دهید.
| with qe.Timer(): | ||
| z_max = compute_max_vmap(grid).block_until_ready() | ||
| # Second run | ||
| z_max = compute_max_vmap(grid) | ||
| # Hold interpreter | ||
| z_max.block_until_ready() |
There was a problem hiding this comment.
در سلول اجرای دوم هم کامنت «Hold interpreter» همان مشکل را دارد: هم انگلیسی است و هم دقیقاً توضیح نمیدهد که block_until_ready() برای اطمینان از اتمام اجرای ناهمگام و صحیح بودن زمانسنجی است. بهتر است کامنت اصلاح/ترجمه شود.
| batch_mm_diff = jax.vmap(mm_diff) # Create a new "vectorized" version | ||
| batch_mm_diff(X) # Apply to each row of X |
There was a problem hiding this comment.
کامنتهای اضافهشده در این بلوک کد (# Create a new "vectorized" version و # Apply to each row of X) انگلیسی هستند. برای نسخهٔ فارسی بهتر است این کامنتها ترجمه شوند یا حذف شوند تا خوانایی یکدست بماند.
| batch_mm_diff = jax.vmap(mm_diff) # Create a new "vectorized" version | |
| batch_mm_diff(X) # Apply to each row of X | |
| batch_mm_diff = jax.vmap(mm_diff) # ایجاد یک نسخهٔ «برداریشده» جدید | |
| batch_mm_diff(X) # اعمال به هر سطرِ X |
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python-programming.
Source PR
#532 - Improve and simplify JAX lectures
Files Updated
lectures/jax_intro.md.translate/state/jax_intro.md.ymllectures/numpy_vs_numba_vs_jax.md.translate/state/numpy_vs_numba_vs_jax.md.ymlDetails
This PR was created automatically by the translation action.