Skip to content

Add CORrelation ALignment domain adaptation - #21

Open
shuo-zhou wants to merge 1 commit into
mainfrom
add-coral
Open

Add CORrelation ALignment domain adaptation#21
shuo-zhou wants to merge 1 commit into
mainfrom
add-coral

Conversation

@shuo-zhou

Copy link
Copy Markdown
Member

Description

Add CORAL (CORrelation ALignment) domain adaptation

Status

Work in progress

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • In-line docstrings updated and documentation docs updated.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.40%. Comparing base (5b9ef29) to head (9cfb315).

Files with missing lines Patch % Lines
kalelinear/transformer/_coral.py 96.10% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
+ Coverage   90.16%   90.40%   +0.23%     
==========================================
  Files          24       25       +1     
  Lines        1922     2000      +78     
==========================================
+ Hits         1733     1808      +75     
- Misses        189      192       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The whitening cutoff can collapse valid low-scale covariance matrices to a zero alignment.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds CORAL domain adaptation with public exports, documentation, and tests.

Changes:

  • Implements covariance-based source-to-target alignment.
  • Exposes CORAL through transformer and embedding APIs.
  • Adds validation, numerical, API, and documentation coverage.
File summaries
File Description
kalelinear/transformer/_coral.py Implements CORAL.
kalelinear/transformer/__init__.py Exports CORAL.
kalelinear/embed.py Adds embedding API alias.
tests/transformer/test_coral.py Tests CORAL behavior and validation.
tests/test_public_api.py Verifies public exposure.
README.md Documents feature and citation.
TUTORIALS.md Adds usage example.
docs/source/usage.rst Describes domain alignment behavior.
docs/source/tutorial.rst Adds CORAL tutorial.
docs/source/introduction.rst Lists CORAL among transformers.
docs/source/api_transformers.rst Adds generated API documentation.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"CORAL cannot compute a whitening transform; try a positive `lambda_`."
)

tolerance = 10 * np.finfo(eigenvalues.dtype).eps * max(1.0, max_eigenvalue) * eigenvalues.shape[0]
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.

2 participants