Skip to content

Information imbalance for representation similarity#49

Merged
Xmaster6y merged 4 commits into
mainfrom
ii
Apr 16, 2026
Merged

Information imbalance for representation similarity#49
Xmaster6y merged 4 commits into
mainfrom
ii

Conversation

@Xmaster6y

@Xmaster6y Xmaster6y commented Apr 16, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Key insights about the PR.

Linked Issues

Checklist

  • I have read the CONTRIBUTING guide.
  • I have added tests for my changes if needed.
  • I have updated the documentation if needed.

Summary by cubic

Adds InformationImbalanceEstimator for directional representation similarity using nearest-neighbor ranks, addressing #34. Exposes it in tdhook.latent, updates the representation similarity notebook with an Information Imbalance section, and adds tests.

  • New Features
    • Introduces tdhook.latent.representation_similarity.InformationImbalanceEstimator computing A→B and B→A from nearest-neighbor rank preservation.
    • Supports (N, D) and batched (..., N, D), configurable p, dtype promotion, and input validation (matching batch shapes/devices, N≥2).
    • Exported via tdhook.latent and tdhook.latent.representation_similarity; notebook adds examples and API notes alongside CkaEstimator.
    • Tests cover custom keys, batching, determinism, dtype promotion, and error cases.

Written for commit a38cf63. Summary will update on new commits.

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (bc7978d) to head (a38cf63).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
+ Coverage   97.30%   97.39%   +0.08%     
==========================================
  Files          41       42       +1     
  Lines        2489     2572      +83     
==========================================
+ Hits         2422     2505      +83     
  Misses         67       67              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 1 file (changes from recent commits).

Requires human review: Introduces a new mathematical estimator (InformationImbalanceEstimator). New feature implementations of algorithms require human verification for correct domain logic.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR introduces a new feature (InformationImbalanceEstimator) with significant logic and a new public API, which warrants human review for implementation correctness and design.

@Xmaster6y Xmaster6y merged commit f416f4c into main Apr 16, 2026
7 checks passed
@Xmaster6y Xmaster6y deleted the ii branch April 16, 2026 09:12
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.

1 participant