Skip to content

Commit f65690d

Browse files
sanbuphyclaude
andcommitted
Complete EN coverage for 4 missing notebooks and restore I-probability emoji
- New EN translations: 16-function-calling, 18-mla-kv-cache, 21-quantization, 23-inference-systems (all 1:1 with ZH: cell count, zero residual CJK, matching ✅ emoji) - I-probability-information: restore ✅ in exercise prints to match ZH - All 41 ZH notebooks now have a 1:1 EN counterpart at file level Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 095f549 commit f65690d

5 files changed

Lines changed: 2680 additions & 3 deletions

File tree

notebooks-en/appendix-advanced/I-probability-information.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@
776776
"assert manual_H is not None, \"please compute manual_H first\"\n",
777777
"assert abs(manual_H - torch_H) < 1e-6, f\"answer should be {torch_H:.6f}, you got {manual_H}\"\n",
778778
"\n",
779-
"print(f\"Exercise 1 passed:\")\n",
779+
"print(f\"Exercise 1 passed:\")\n",
780780
"print(f\" H(p) = {manual_H:.4f}\")\n",
781781
"print(f\" theoretical maximum log(4) = {math.log(4):.4f}\")\n",
782782
"print(f\" p is more certain than uniform, so its entropy is smaller than log(4)\")\n"
@@ -819,7 +819,7 @@
819819
"assert torch.allclose(manual_lp, torch_lp, atol=1e-5), \\\n",
820820
" f\"result inconsistent with PyTorch\\nyou got: {manual_lp.tolist()}\\nPyTorch: {torch_lp.tolist()}\"\n",
821821
"\n",
822-
"print(\"Exercise 2 passed:\")\n",
822+
"print(\"Exercise 2 passed:\")\n",
823823
"print(f\" log_softmax = {[round(x, 4) for x in manual_lp.tolist()]}\")\n",
824824
"print(f\" corresponding probs = {[round(x, 4) for x in torch.exp(manual_lp).tolist()]}\")\n",
825825
"print(f\" sum of probs = {torch.exp(manual_lp).sum().item():.6f}\")\n",
@@ -867,7 +867,7 @@
867867
"assert abs(ce - expected_ce) < 1e-6\n",
868868
"assert abs(ppl - expected_ppl) < 1e-3\n",
869869
"\n",
870-
"print(f\"Exercise 3 passed:\")\n",
870+
"print(f\"Exercise 3 passed:\")\n",
871871
"print(f\" average CE = {ce:.4f}\")\n",
872872
"print(f\" PPL = {ppl:.4f}\")\n",
873873
"print(f\" vocabulary V = {V}\")\n",

0 commit comments

Comments
 (0)