CORALDomainAdapter<T>

Models & Types · AiDotNet.TransferLearning.DomainAdaptation

Implements domain adaptation using CORrelation ALignment (CORAL).

Implements: IDomainAdapter<T>

For Beginners

CORAL (CORrelation ALignment) aligns the second-order statistics (covariances) of source and target domains. Think of it as making sure the “spread” and “correlation patterns” of features are similar in both domains.

How It Works

Imagine you have two datasets: one where features vary a lot, and another where they vary less. CORAL adjusts the data so both have similar variability patterns, making transfer learning more effective.

Constructors

Constructor Summary
CORALDomainAdapter() Initializes a new instance of the CORALDomainAdapter class.

Properties

Property Summary
bool RequiresTraining { get; } Gets whether this adapter requires training.
string AdaptationMethod { get; } Gets the name of the adaptation method.

Methods

Method Summary
Matrix<T> AdaptSource(Matrix<T> sourceData, Matrix<T> targetData) Adapts source data to match target distribution using CORAL.
Matrix<T> AdaptTarget(Matrix<T> targetData, Matrix<T> sourceData) Adapts target data to match source distribution.
T ComputeDomainDiscrepancy(Matrix<T> sourceData, Matrix<T> targetData) Computes the domain discrepancy using Frobenius norm of covariance difference.
void Train(Matrix<T> sourceData, Matrix<T> targetData) Trains the CORAL adapter by computing the transformation matrix.