SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1607.01719 · 2016

Deep CORAL: Correlation Alignment for Deep Domain Adaptation

Kate Saenko, Baochen Sun

arXiv · PDF · Open in the Atlas

Code that ran

10 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 6 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1607.01719.json · badge: /api/ran/1607.01719.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
armavox/deepcoral-pchelkin community
Papers with Code archive
2 ran · 3 no recorded run
lzx6/deep-coral community
Papers with Code archive
2 ran · 0 no recorded run
kevinmusgrave/pytorch-adapt community
Papers with Code archive
2 ran · 0 no recorded run
agrija9/deep-unsupervised-domain-adaptation community
Papers with Code archive
2 ran · 0 no recorded run
thuml/Transfer-Learning-Library community
Papers with Code archive
1 ran · 0 no recorded run
JorisRoels/domain-adaptive-segmentation community
Papers with Code archive
1 ran · 0 no recorded run
facebookresearch/DomainBed community
Papers with Code archive
0 ran · 2 no recorded run
adapt-python/adapt community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
CORAL Ran
ran, honoured the contract we drafted
armavox/deepcoral-pchelkin/models.py
pointer only (licence: NONE) · get_code("295efb43ef25a954")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, armavox/deepcoral-pchelkin when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

CORAL Ran
ran, honoured the contract we drafted
lzx6/deep-coral/models/model.py
pointer only (licence: NONE) · get_code("15c3cda03d9ac2cf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lzx6/deep-coral when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

CORALLoss Ran
ran on a synthesized input
kevinmusgrave/pytorch-adapt/src/pytorch_adapt/layers/coral_loss.py
code served (permissive licence) · get_code("de91a436de3e98be")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 4),
    'y': torch.randn(2, 4),
}

def covariance(x):
    batch_size = x.shape[0]
    mm1 = torch.mm(x.t(), x)
    cols_summed = torch.sum(x, dim=0)
    mm2 = torch.mm(cols_summed.unsqueeze(1), cols_summed.unsqueeze(0))
    return 1.0 / (batch_size - 1) * (mm1 - 1.0 / batch_size * mm2)

class CORALLoss(torch.nn.Module):
    """
    Implementation of [Deep CORAL:
    Correlation Alignment for
    Deep Domain Adaptation](https://arxiv.org/abs/1607.01719)
    """

    def forward(self, x: torch.Tensor, y: torch.Tensor):
        """
        Arguments:
            x: features from one domain
            y: features from the other domain
        """
        embedding_size = x.shape[1]
        cx = covariance(x)
        cy = covariance(y)
        squared_fro_norm = torch.linalg.norm(cx - cy, ord='fro') ** 2
        return squared_fro_norm / (4 * embedding_size ** 2)

model = CORALLoss(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
CORAL_loss Ran
ran, honoured the contract we drafted
agrija9/deep-unsupervised-domain-adaptation/DeepCORAL/loss.py
pointer only (licence: NONE) · get_code("4b8de823e75cac7b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, agrija9/deep-unsupervised-domain-adaptation when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

CorrelationAlignmentLoss Ran
ran on a synthesized input
thuml/Transfer-Learning-Library/tllib/alignment/coral.py
code served (permissive licence) · get_code("a84628149542a7b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# INIT_ARGS: CorrelationAlignmentLoss.__init__ takes no parameters
INIT_ARGS = {}

# ARGS: forward method takes f_s and f_t
# f_s, f_t: (N, d) where N is batch size and d is feature dimension
# Using N=5 (batch size) and d=7 (feature dimension) for distinct sizes
ARGS = {
    'f_s': torch.randn(5, 7),
    'f_t': torch.randn(5, 7)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResNet Ran
ran on a synthesized input · constructed an object; no result was computed
armavox/deepcoral-pchelkin/models.py
pointer only (licence: NONE) · get_code("e943a5936303c3e2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, armavox/deepcoral-pchelkin when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

compute_covariance Ran
ran; our contract draft was wrong, not the code
agrija9/deep-unsupervised-domain-adaptation/DeepCORAL/loss.py
pointer only (licence: NONE) · get_code("8999f477df9b3767")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, agrija9/deep-unsupervised-domain-adaptation when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

coral Ran
ran, honoured the contract we drafted
JorisRoels/domain-adaptive-segmentation/networks/base.py
pointer only (licence: NONE) · get_code("24e855154e03cf28")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, JorisRoels/domain-adaptive-segmentation when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

coral Ran
ran; our contract draft was wrong, not the code
lzx6/deep-coral/models/model.py
pointer only (licence: NONE) · get_code("e7a4be2ab7eed817")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lzx6/deep-coral when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

covariance Ran
ran; our contract draft was wrong, not the code
kevinmusgrave/pytorch-adapt/src/pytorch_adapt/layers/coral_loss.py
code served (permissive licence) · get_code("9e5d22eb6001e5ea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects a tensor x with shape (batch_size, num_features)
# It computes covariance using matrix operations: x.t() @ x
# Let's create a small tensor with batch_size=2 and num_features=4
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
AbstractMMD Not yet run
unverified (harvested, no recorded run)
facebookresearch/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("5c549cbd1a842c90")
How it ran

no invocation recorded.

CORAL Not yet run
unverified (harvested, no recorded run)
facebookresearch/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("c8f9fe6b62dc42e7")
How it ran

no invocation recorded.

DeepCORAL Not yet run
unverified (harvested, no recorded run)
adapt-python/adapt/adapt/feature_based/_deepcoral.py
code served (permissive licence) · get_code("05c0bd2077dca49a")
How it ran

no invocation recorded.

DeepCoral Not yet run
unverified (harvested, no recorded run)
armavox/deepcoral-pchelkin/models.py
pointer only (licence: NONE) · get_code("3c2fda392ca79c64")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, armavox/deepcoral-pchelkin when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

load_net Not yet run
unverified (harvested, no recorded run)
armavox/deepcoral-pchelkin/models.py
pointer only (licence: NONE) · get_code("6d9d07aae0108daf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, armavox/deepcoral-pchelkin when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

resnet50 Not yet run
unverified (harvested, no recorded run)
armavox/deepcoral-pchelkin/models.py
pointer only (licence: NONE) · get_code("c6fffe6dc1d50a45")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, armavox/deepcoral-pchelkin when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 16 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Deep neural networks are able to learn powerful representations from large quantities of labeled input data, however they cannot always generalize well across changes in input distributions. Domain adaptation algorithms have been proposed to compensate for the degradation in performance due to domain shift. In this paper, we address the case when the target domain is unlabeled, requiring unsupervised adaptation. CORAL[1] is a "frustratingly easy" unsupervised domain adaptation method that aligns the second-order statistics of the source and target distributions with a linear transformation. Here, we extend CORAL to learn a nonlinear transformation that aligns correlations of layer activations in deep neural networks (Deep CORAL). Experiments on standard benchmark datasets show state-of-the-art performance.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1607.01719")
get_code_for_paper("1607.01719")
have("1607.01719")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1607.01719.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1607.01719.svg)](https://syntology.ai/paper/1607.01719)

Connect an agent — have() is free.