SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.18615 · NeurIPS · 2023

Temporally Disentangled Representation Learning under Unknown Nonstationarity

Kun Zhang, Eric Xing, Xinshuai Dong, Xiangchen Song, Weiran Yao, Yewen Fan, Guangyi Chen, Juan Niebles

arXiv · PDF · Open in the Atlas

Code that ran

4 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2310.18615.json · badge: /api/ran/2310.18615.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
xiangchensong/nctrl canonical (classifier label)
classifier basis: classifier_2025
4 ran · 6 no recorded run
FunctionStatusWhere it lives
BetaVAE_MLP Ran
ran on a synthesized input
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("a1721aeb9590a95b")
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 tuple. The image it ran in was not recorded. If your copy returns the same type 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
import torch.nn.init as init

def kaiming_init(m):
    if isinstance(m, (nn.Linear, nn.Conv2d)):
        init.kaiming_normal_(m.weight)
        if m.bias is not None:
            m.bias.data.fill_(0)
    elif isinstance(m, (nn.BatchNorm1d, nn.BatchNorm2d)):
        m.weight.data.fill_(1)
        if m.bias is not None:
            m.bias.data.fill_(0)

def reparametrize(mu, logvar):
    std = logvar.div(2).exp()
    eps = std.data.new(std.size()).normal_()
    return mu + std * eps

class BetaVAE_MLP(nn.Module):
    """Model proposed in original beta-VAE paper(Higgins et al, ICLR, 2017)."""

    def __init__(self, input_dim=3, z_dim=10, hidden_dim=128, leaky_relu_slope=0.2):
        super(BetaVAE_MLP, self).__init__()
        self.z_dim = z_dim
        self.input_dim = input_dim
        self.encoder = nn.Sequential(nn.Linear(input_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, 2 * z_dim))
        self.decoder = nn.Sequential(nn.LeakyReLU(leaky_relu_slope), nn.Linear(z_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, hidden_dim), nn.LeakyReLU(leaky_relu_slope), nn.Linear(hidden_dim, input_dim))
        self.weight_init()

    def weight_init(self):
        for block in self._modules:
            for m in self._modules[block]:
                kaiming_init(m)

    def forward(self, x, return_z=True):
        distributions = self._encode(x)
        mu = distributions[..., :self.z_dim]
        logvar = distributions[..., self.z_dim:]
        z = reparametrize(mu, logvar)
        x_recon = self._decode(z)
        if return_z:
            return (x_recon, mu, logvar, z)
        else:
            return (x_recon, mu, logvar)

    def _encode(self, x):
        return self.encoder(x)

    def _decode(self, z):
        return self.decoder(z)


INIT_ARGS = {
    'input_dim': 4,
    'z_dim': 3,
    'hidden_dim': 16,
    'leaky_relu_slope': 0.2
}

ARGS = {
    'x': torch.randn(2, 4),
    'return_z': True
}
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 tuple — a tuple output has no array shape of its own; none is stated
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)
MLP Ran
ran on a synthesized input
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("4f1b59dd54f8802a")
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 2, dtype family float, shape (2, 3) 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
import torch.nn as nn

class MLP(nn.Module):
    """A simple MLP with ReLU activations"""

    def __init__(self, input_dim, hidden_dim, output_dim, num_layers, leaky_relu_slope=0.2):
        super().__init__()
        layers = []
        for l in range(num_layers):
            if l == 0:
                layers.append(nn.Linear(input_dim, hidden_dim))
                layers.append(nn.LeakyReLU(leaky_relu_slope))
            else:
                layers.append(nn.Linear(hidden_dim, hidden_dim))
                layers.append(nn.LeakyReLU(leaky_relu_slope))
        layers.append(nn.Linear(hidden_dim, output_dim))
        self.net = nn.Sequential(*layers)

    def forward(self, x):
        return self.net(x)


INIT_ARGS = {
    'input_dim': 4,
    'hidden_dim': 8,
    'output_dim': 3,
    'num_layers': 2,
    'leaky_relu_slope': 0.2,
}

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

if __name__ == '__main__':
    model = MLP(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
compute_acc Ran
ran; our contract draft was wrong, not the code
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("1faa8b8bebc32849")
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 tuple. The image it ran in was not recorded. If your copy returns the same type 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 numpy as np
from scipy import optimize

# Analyze the function signature and body
# Parameters: cs_true, cs_est, C
# - cs_true: array-like, flattened to 1D, contains true cluster assignments
# - cs_est: array-like, flattened to 1D, contains estimated cluster assignments
# - C: int, number of clusters
#
# The function:
# 1. Flattens both cs_true and cs_est
# 2. Creates a C x C confusion matrix
# 3. Iterates over cluster indices 0 to C-1
# 4. Uses linear_sum_assignment on the matrix
# 5. Maps cs_est values using matchidx array

# Create valid test data
np.random.seed(0)

# Number of clusters
C = 3

# Number of samples
n_samples = 8

# True cluster assignments (random from 0 to C-1)
cs_true = np.random.randint(0, C, size=n_samples)

# Estimated cluster assignments (random from 0 to C-1, slightly different from true)
cs_est = np.random.randint(0, C, size=n_samples)

ARGS = {
    "cs_true": cs_true,
    "cs_est": cs_est,
    "C": C
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
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
reparametrize Ran
ran; our contract draft was wrong, not the code
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("3188157d3b1c95e6")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 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)

# Create small tensors for mu and logvar
# mu: mean of the distribution, shape (2, 4)
mu = torch.randn(2, 4)

# logvar: log variance of the distribution, shape (2, 4)
logvar = torch.randn(2, 4)

ARGS = {
    "mu": mu,
    "logvar": logvar,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (2, 4) — shape (2, 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
CTDRL Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("edee331006f13f67")
How it ran

no invocation recorded.

HMM Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("7a27a56f18e33cc3")
How it ran

no invocation recorded.

NCTRL Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("398b239132b34104")
How it ran

no invocation recorded.

NPChangeTransitionPrior Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("fdd6eda03ec3460e")
How it ran

no invocation recorded.

compute_mcc Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("071485900d2c03f0")
How it ran

no invocation recorded.

compute_mcc_tdrl Not yet run
unverified (harvested, no recorded run)
xiangchensong/nctrl/models/simulation.py
code served (permissive licence) · get_code("aed451e219a1dc14")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
compute_acc
brick of this paper's assembly: helper
1 other paper
1 later
2409.03142 (2024-09)
Causal Temporal Representation Learning with Nonstationary Sparse Transition
reparametrize
brick of this paper's assembly: helper
1 other paper
1 later
2409.03142 (2024-09)
Causal Temporal Representation Learning with Nonstationary Sparse Transition

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-23.

Repositories linked to this paper

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

Abstract

In unsupervised causal representation learning for sequential data with time-delayed latent causal influences, strong identifiability results for the disentanglement of causally-related latent variables have been established in stationary settings by leveraging temporal structure. However, in nonstationary setting, existing work only partially addressed the problem by either utilizing observed auxiliary variables (e.g., class labels and/or domain indexes) as side-information or assuming simplified latent causal dynamics. Both constrain the method to a limited range of scenarios. In this study, we further explored the Markov Assumption under time-delayed causally related process in nonstationary setting and showed that under mild conditions, the independent latent components can be recovered from their nonlinear mixture up to a permutation and a component-wise transformation, without the observation of auxiliary variables. We then introduce NCTRL, a principled estimation framework, to reconstruct time-delayed latent causal variables and identify their relations from measured sequential data only. Empirical evaluations demonstrated the reliable identification of time-delayed latent causal influences, with our methodology substantially outperforming existing baselines that fail to exploit the nonstationarity adequately and then, consequently, cannot distinguish distribution shifts.

For agents

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

get_harvested_code_for_paper("2310.18615")
get_code_for_paper("2310.18615")
have("2310.18615")

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

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

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

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

Connect an agent — have() is free.