Skip to content

Write the base-2 entropy, cross-entropy and divergence with their macros - #108

Open
d-morrison wants to merge 4 commits into
mainfrom
claude/base-two-entropy
Open

d-morrison wants to merge 4 commits into
mainfrom
claude/base-two-entropy

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Closes #106.

Seven fragments wrote the Shannon entropy, cross-entropy and divergence as H_2(p), H_2(p, q) and D_2(p \,\|\, q), where the 2 means base-2 logarithms. The same site writes the Rényi entropy of order 2 as \renyientropyf{2}{X}, which prints the same glyph, so a reader could not tell the two apart. They now use the existing macros \entropyf, \crossentropyf and \kldivf, and the prose says "base-2 logarithms" where each result is stated.

Files: _thm-source-coding, _thm-wrong-code, _rem-cross-entropy-wrong-code, _exm-cross-entropy-decomposition, _rem-cross-entropy-loss, _thm-cross-entropy-decomposition, and _thm-kl-divergence-nonnegative. The last is a seventh file beyond the six that #106 lists; it writes D_2 the same way, and its proof uses the factor ln 2, so the statement and that proof line now say the divergence uses base-2 logarithms.

Edited lines gained links for the terms the term-link check found there: bits, binary digits, uniquely decodable code, loss and logarithms.

Checks run locally. Rendered entropy.qmd and source-coding.qmd to HTML: no H_2 or D_2 remains in source-coding.html, and the expanded math shows the macros' output. The only warning is downlit and xml2 missing from this machine. I looked at the expanded math in the built HTML, not a browser render. The term-link check passes through the push hook. 7 files, 21 lines changed, plus the term links.

Not changed: the collision entropy fragments, which ids#100 converts to \renyientropyf. The two PRs touch different files and can merge in either order.



Generated by Claude Code

The fragments wrote them as H_2 and D_2, which reads as the Renyi entropy of
order 2 (collision entropy) used elsewhere on the site. Use \entropyf,
\crossentropyf and \kldivf, and say base-2 logarithms in the prose.
Closes #106.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9puSJHfSFxeRBZUfnt
Link bits, binary digits, uniquely decodable code, loss and logarithms
on the lines of the base-2 notation change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9puSJHfSFxeRBZUfnt
Copilot AI balanced review requested due to automatic review settings November 8, 2026 05:59

Copy link
Copy Markdown
Contributor Author

/review

Requesting the Claude review on the current head.
Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9puSJHfSFxeRBZUfnt
Copilot AI balanced review requested due to automatic review settings November 8, 2026 06:59

Copy link
Copy Markdown
Contributor Author

/review

Merged main into the branch (head 3747d44); the merge adds check-gradient-lhs.yml and changes no fragment. Requesting the Claude review on the current head.
Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The Claude review found the base-2 proof line holding three clauses.
Break it, the statement line beside it, and the loss line at clauses.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9puSJHfSFxeRBZUfnt
Copilot AI balanced review requested due to automatic review settings November 8, 2026 07:02

Copy link
Copy Markdown
Contributor Author

/review

Fixed the blocking finding in eeb5cec: the proof line at _thm-kl-divergence-nonnegative.qmd:41 now breaks after each of its three clauses, and so does the statement line at line 10 of that file. I also moved the loss link in _rem-cross-entropy-loss.qmd onto its own line, as the review suggested. I left the binary digits link: the term-link check requires a link on that edited line, and #def-bit is the closest definition. Requesting the Claude review on the current head.
Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Claude finished review — View run


I reviewed commit eeb5cec, the only unreviewed commit since round 2. It only re-wraps lines and changes no wording, math or links.

Prior blocking finding is fixed.

  • _subfiles/_thm-kl-divergence-nonnegative.qmd:43-45: this was the blocking finding from the round 2 review. The three-clause sentence is now broken after each clause, as that review suggested.
  • _subfiles/_thm-kl-divergence-nonnegative.qmd:10-12: the "Then the … divergence, with base-2 logarithms, satisfies" sentence is now split into clause-level lines. That sentence was already in an earlier version of this PR and wasn't flagged before.
  • _subfiles/_rem-cross-entropy-loss.qmd:15-17: the long line holding the [loss] link is now split. This was the non-blocking suggestion from round 2.

Rule 12 check. Each remaining line holds at most one clause. The split …$\crossentropyf{e}{q}$ / equals $\kldivf{e}{q}$: is a single main clause. The link and the "satisfies" fragment are short phrases, not clauses.

Markup. Link targets are unchanged. The split Markdown link text in _rem-cross-entropy-loss.qmd:15-16 still sits on one line, with the [loss](…) link intact. The edit adds no math and no macro changes, so the macro findings from rounds 1 and 2 still hold.

Carried-over suggestion, non-blocking. _subfiles/_thm-source-coding.qmd:19 links "binary digits" to #def-bit. Check that the bit definition equates the two terms.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "eeb5ceca144e71773ac2041707598914dc97a60f",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The new commit breaks the three-clause proof line in _thm-kl-divergence-nonnegative.qmd after each clause and splits the long loss-link line in _rem-cross-entropy-loss.qmd; links and macros are unchanged.",
  "holistic_assessment": "The commit addresses the one blocking line-break finding from the previous round with no wording or scope change, so the earlier macro, anchor and base-2 checks still stand."
}

Reviewed commit: eeb5cec

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

💰 Cost: $0.1806 (review) — run

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/ids/pr-preview/pr-108/

Built to branch gh-pages at 2026-11-08 07:05 UTC.

@d-morrison

Copy link
Copy Markdown
Contributor Author

Annotation review for head eeb5ceca: 23 passing check runs carry annotations, and I read the text of every one through the check-runs annotations API. The classes present are: the runner-wide ubuntu-latest migration notice; the SUBMODULES_TOKEN is empty notice. None concerns this PR's files. I am passing the ids to check-pr-fully-clean.py --annotations-read.

agy's quota is exhausted, so I ran the checker with --reviewer-out-of-quota agy; the Claude CI review on this head is the substitute.

Posted by Claude Code (AI agent) --- not written by a human.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop writing the base-2 entropy as H_2, which reads as the Rényi entropy of order 2

3 participants