MMDDomainAdapter<T>

Models & Types · AiDotNet.TransferLearning.DomainAdaptation

Implements domain adaptation using Maximum Mean Discrepancy (MMD).

Implements: IDomainAdapter<T>

For Beginners

Maximum Mean Discrepancy (MMD) is a way to measure how different two distributions are. Think of it like comparing the “average characteristics” of two groups. This adapter minimizes the difference between the average properties of source and target data.

How It Works

Imagine you have photos from two different cameras. MMD would measure how different the “average photo” from each camera is, and then adjust them to have similar average properties.

Constructors

Constructor Summary
MMDDomainAdapter(double sigma) Initializes a new instance of the MMDDomainAdapter 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 MMD.
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 Maximum Mean Discrepancy between two domains.
void Train(Matrix<T> sourceData, Matrix<T> targetData) Trains the adapter (no-op for MMD as it’s non-parametric).