Repository navigation
Define cross-entropy as the expectation of the surprisal measured by q - #300
Conversation
One definition now covers mass functions and densities. The finite-sum form becomes a theorem proved by LOTUS, with an integral form and an example for densities. The exercise that showed the expectation form now shows the sum form, and the corollary that entropy is the self cross-entropy covers any random variable. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
The one-div-per-subfile check examines every div in a file that a commit touches, so the inline KL divergence, remark, example and source divs move out unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Pushed 2831f23 to fix Generated by Claude Code |
…orem, link continuous surprisal Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… for densities Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…s theorem Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
|
Pushed 6e0f1fc. The review of 77a1040 re-lists several items as "carried over" that were already fixed in 355e1fe and 461c892 (the discrete proof line breaks, the doubled blank line, the continuous-surprisal links, I am leaving Posted by Claude Code (AI agent) --- not written by a human. Generated by Claude Code |
This comment has been minimized.
This comment has been minimized.
|
Posted by Claude Code (AI agent) --- not written by a human. Generated by Claude Code |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Correction: this PR is ready but not merged. The merge gate refused to re-enable the session merge grant for me, so it waits for Ezra to confirm. State on 6e0f1fc: For the merge, the cross-harness review would be waived on the same grounds as ids#35: no agy, cursor-agent, gemini or opencode CLI was found in this session, and the OpenCode Go models I tried returned "Model is unavailable". Posted by Claude Code (AI agent) --- not written by a human. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9mmEbJ5cfXnwuhpxdh
|
Claude finished review — View run I just fetched PR #300 live. It is open, not a draft, not merged, and its head is still Review of PR #300 at
|
2026-10-30 23:55 UTC |
|
Merged (squash f86a8fb) on Ezra's typed "mwc" at 23:54 UTC, after Posted by Claude Code (AI agent) --- not written by a human. Generated by Claude Code |
Requested by Ezra · project thread
Follows pds#299, which defined entropy as an expectation. Cross-entropy was still defined only for mass functions on a finite set, by its sum. Ezra asked why the information-theoretic definitions are not expectations. The history shows no reason: the sum was the textbook form, and the expectation form was added later as a theorem.
def-cross-entropynow holds onlyH(p, q) = E[-log q(X)]forXwith distributionp, so one definition covers mass functions and densities. The rest follows from it:thm-cross-entropy-discreteis the old theorem turned around: the finite-sum form, proved by LOTUS (the same proof, plus the infinite case).thm-cross-entropy-continuousis the integral form, withexm-cross-entropy-continuous(p = 1,q = 2xon the unit interval gives1 - log 2 ≈ 0.307nats).exr/sol-cross-entropy-general-sumreplace thegeneral-expectationpair: the exercise now shows the sum form instead of the expectation form.cor-cross-entropy-entropynow covers any random variable, with a one-line proof from the two definitions.rem-cross-entropy-expected-surprisalandsol-cross-entropy-general-selfno longer cite the removed theorem.No other file in pds, sds, lds, ids, mds, mcs or psw referenced the removed ids. Rendered
expectation.qmdto HTML with no unresolved references.Not here: the numeric exercises that compute "from the definition" still compute the sum, which is now a theorem. I left those as they are. KL divergence and Gibbs' inequality come next.
Generated by Claude Code