SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.04942 · 2018

Isolating Sources of Disentanglement in Variational Autoencoders

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 1 has no contract verdict; 5 failures of our instrument; 3 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/1802.04942.json · badge: /api/ran/1802.04942.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
rtqichen/beta-tcvae canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
tianyu-lu/tcvae community (classifier label)
classifier basis: plan_row
4 ran · 2 no recorded run
voxmenthe/beta-tcvae_v1 community (classifier label)
classifier basis not recorded on the link
0 ran · 1 no recorded run
FunctionStatusWhere it lives
MIG Ran
ran; our contract draft was wrong, not the code
tianyu-lu/tcvae/metric_helpers/mi_metric.py
code served (permissive licence) · get_code("223acfe09c0cf307")
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 0, dtype family float, shape () 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)

# MIG expects mi_normed to be a 2D tensor where we can index [:, 0] and [:, 1]
# It computes mean of (first column - second column)
# We'll create a small tensor with shape (batch_size, 2) where batch_size=2
mi_normed = torch.randn(2, 2)

ARGS = {
    "mi_normed": mi_normed
}
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 0, dtype family float, shape () — shape () 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
analytical_NLL Ran
ran; our contract draft was wrong, not the code
tianyu-lu/tcvae/elbo_decomposition.py
code served (permissive licence) · get_code("4ebef74ecd436d41")
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, ndim 2, 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
from torch.autograd import Variable
import torch.nn as nn

torch.manual_seed(0)

# Build minimal distribution classes that implement the NLL method
class MockDistribution(nn.Module):
    def __init__(self, output_size):
        super().__init__()
        self.output_size = output_size
    
    def NLL(self, params, qz_params=None):
        """Returns negative log likelihood with shape matching first dimension"""
        # params shape: (N, K, nparams) or (1, K, nparams)
        # Return shape: (N, K) or (1, K)
        batch_size = params.size(0)
        num_latents = params.size(1)
        # Return a tensor of shape (batch_size, num_latents)
        return Variable(torch.ones(batch_size, num_latents))

# Create distribution instances
q_dist = MockDistribution(output_size=3)
prior_dist = MockDistribution(output_size=3)

# Create qz_params: (N=2, K=3, nparams=4)
# N=2 batch size, K=3 latent dims, nparams=4 parameters per latent
qz_params = Variable(torch.randn(2, 3, 4))

# qz_samples can be None as per the function signature
qz_samples = None

ARGS = {
    'qz_params': qz_params,
    'q_dist': q_dist,
    'prior_dist': prior_dist,
    'qz_samples': qz_samples
}
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 tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
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
estimate_entropies Ran
ran; our contract draft was wrong, not the code
tianyu-lu/tcvae/elbo_decomposition.py
code served (permissive licence) · get_code("90c6b85fc73eaff7")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 math
from torch.autograd import Variable

torch.manual_seed(0)

# Stand-in class for q_dist that implements the required interface
class MockQDist:
    def __init__(self, nparams=2):
        self.nparams = nparams
    
    def log_density(self, samples, params):
        """
        Compute log density.
        samples: (N, K, S_batch)
        params: (N, K, S_batch, nparams)
        Returns: (N, K, S_batch)
        """
        # Simple mock implementation: return random log probabilities
        N, K, S_batch = samples.shape
        return torch.randn(N, K, S_batch)

# Create mock q_dist
q_dist = MockQDist(nparams=2)

# Create qz_samples: (K, S) Variable
# K = 4 (latent dimension), S = 100 (number of samples)
K = 4
S = 100
qz_samples = Variable(torch.randn(K, S))

# Create qz_params: (N, K, nparams) Variable
# N = 3 (number of data points), K = 4 (latent dimension), nparams = 2
N = 3
nparams = 2
qz_params = Variable(torch.randn(N, K, nparams))

ARGS = {
    "qz_samples": qz_samples,
    "qz_params": qz_params,
    "q_dist": q_dist,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
isnan Ran
ran on a synthesized input
rtqichen/beta-tcvae/lib/utils.py
code served (permissive licence) · get_code("005ab5343cd3459c")
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 1, dtype family float, shape (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 isnan(tensor) checks if tensor != tensor
# This works on torch tensors and returns a boolean tensor
# We need to pass a tensor that supports the != operator

tensor = torch.tensor([1.0, float('nan'), 3.0, 4.0])

ARGS = {
    "tensor": tensor
}
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 1, dtype family float, shape (4,) — shape (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
logsumexp Ran
ran; our contract draft was wrong, not the code
tianyu-lu/tcvae/elbo_decomposition.py
code served (permissive licence) · get_code("fca04e40e0d22d1e")
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 1, dtype family float, shape (2,) 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 math

torch.manual_seed(0)

# Test Case 1: logsumexp with dim specified and keepdim=False
value_with_dim = torch.randn(2, 4)
ARGS = {
    "value": value_with_dim,
    "dim": 1,
    "keepdim": False
}
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 1, dtype family float, shape (2,) — shape (2,) 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
logsumexp Ran
ran; our contract draft was wrong, not the code
rtqichen/beta-tcvae/lib/utils.py
code served (permissive licence) · get_code("0213e98ab9ef1e9b")
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 1, dtype family float, shape (2,) 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 math
from numbers import Number

torch.manual_seed(0)

# Test case 1: with dim and keepdim parameters
value_tensor = torch.randn(2, 4)

ARGS = {
    "value": value_tensor,
    "dim": 1,
    "keepdim": False
}
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 1, dtype family float, shape (2,) — shape (2,) 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
compute_metric_faces Not yet run
unverified (harvested, no recorded run)
tianyu-lu/tcvae/metric_helpers/mi_metric.py
code served (permissive licence) · get_code("c6b4e17ded1255db")
How it ran

no invocation recorded.

compute_metric_shapes Not yet run
unverified (harvested, no recorded run)
tianyu-lu/tcvae/metric_helpers/mi_metric.py
code served (permissive licence) · get_code("f1bd7b98a30a255d")
How it ran

no invocation recorded.

estimate_entropies Not yet run
unverified (harvested, no recorded run)
voxmenthe/beta-tcvae_v1/elbo_decomposition.py
code served (permissive licence) · get_code("868dd11974b99556")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 7 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 7 later) and 0 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
logsumexp 5 other papers
1 dated earlier, 4 later
1710.11417 (2017-10)
TreeQN and ATreeC: Differentiable Tree-Structured Models for Deep Reinforcement Learning
1809.10341 (2018-09)
Deep Graph Infomax
1906.02735 (2019-06)
Residual Flows for Invertible Generative Modeling
and 2 more not named here
isnan 2 other papers
2 later
1906.02735 (2019-06)
Residual Flows for Invertible Generative Modeling
2002.02798 (2020-02)
How to Train Your Neural ODE: the World of Jacobian and Kinetic Regularization
MIG 1 other paper
1 later
2401.04890 (2024-01)
Nonparametric Partial Disentanglement via Mechanism Sparsity: Sparse Actions, Interventions and Sparse Temporal Dependencies
analytical_NLL 1 other paper
1 later
2401.04890 (2024-01)
Nonparametric Partial Disentanglement via Mechanism Sparsity: Sparse Actions, Interventions and Sparse Temporal Dependencies
compute_metric_faces 1 other paper
1 later
2401.04890 (2024-01)
Nonparametric Partial Disentanglement via Mechanism Sparsity: Sparse Actions, Interventions and Sparse Temporal Dependencies
compute_metric_shapes 1 other paper
1 later
2401.04890 (2024-01)
Nonparametric Partial Disentanglement via Mechanism Sparsity: Sparse Actions, Interventions and Sparse Temporal Dependencies
estimate_entropies 1 other paper
1 later
2401.04890 (2024-01)
Nonparametric Partial Disentanglement via Mechanism Sparsity: Sparse Actions, Interventions and Sparse Temporal Dependencies

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

We decompose the evidence lower bound to show the existence of a term measuring the total correlation between latent variables. We use this to motivate our $β$-TCVAE (Total Correlation Variational Autoencoder), a refinement of the state-of-the-art $β$-VAE objective for learning disentangled representations, requiring no additional hyperparameters during training. We further propose a principled classifier-free measure of disentanglement called the mutual information gap (MIG). We perform extensive quantitative and qualitative experiments, in both restricted and non-restricted settings, and show a strong relation between total correlation and disentanglement, when the latent variables model is trained using our framework.

For agents

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

get_harvested_code_for_paper("1802.04942")
get_code_for_paper("1802.04942")
have("1802.04942")

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

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

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

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

Connect an agent — have() is free.