SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1612.00410 · 2016

Deep Variational Information Bottleneck

Ian Fischer, Joshua Dillon, Alexander Alemi, Kevin Murphy

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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 5 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-23; 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/1612.00410.json · badge: /api/ran/1612.00410.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
mohith-sakthivel/mine-pytorch community
Papers with Code archive
4 ran · 4 no recorded run
shijing001/VIB_audio_classification community
Papers with Code archive
1 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
BetaScheduler Ran
ran on a synthesized input
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("9618f5823ecd71d0")
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 float, 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
import numpy as np

class BetaScheduler:
    """
        Schedules beta after an intial warmup period. Value is annealed from 
        the intial value to the steady state value linearly.
    """

    def __init__(self, warm_up, value, anneal_period, init_value=0):
        self._warm_up = warm_up
        self._value = value
        self._anneal_period = anneal_period
        self._init_value = init_value

    def get(self, epoch):
        if epoch <= self._warm_up:
            return self._init_value
        elif epoch > self._warm_up + self._anneal_period:
            return self._value
        else:
            ratio = (epoch - self._warm_up) / self._anneal_period
            return ratio * (self._value - self._init_value) + self._init_value


INIT_ARGS = {
    'warm_up': 5,
    'value': 1.0,
    'anneal_period': 10,
    'init_value': 0.0
}

ARGS = {
    'epoch': 8
}

METHOD = 'get'


if __name__ == '__main__':
    scheduler = BetaScheduler(**INIT_ARGS)
    result = scheduler.get(**ARGS)
    print(f"Beta at epoch {ARGS['epoch']}: {result}")
    
    print("\nTesting multiple epochs:")
    for epoch in [0, 5, 8, 15, 20]:
        print(f"  epoch {epoch}: {scheduler.get(epoch)}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Classifier Ran
ran on a synthesized input
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("ac5e73aab4b5b37d")
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 dict. 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
from pathlib import Path
import tempfile

# Create a simple base network
class SimpleBaseNet(nn.Module):
    def __init__(self, input_dim, output_dim, hidden_dim=8):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, hidden_dim)
        self.fc2 = nn.Linear(hidden_dim, output_dim)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        return self.fc2(x)
    
    def is_stochastic(self):
        return False

# Create a simple logger mock
class SimpleLogger:
    def scalar(self, value, name, accumulator=None, progbar=False):
        pass

# Create temporary directory for logdir
temp_dir = tempfile.mkdtemp()

INIT_ARGS = {
    'base_net': SimpleBaseNet,
    'K': 6,
    'lr': 0.0001,
    'base_net_args': {'hidden_dim': 8},
    'use_polyak': True,
    'logdir': Path(temp_dir)
}

# Create batch data: images (batch_size=2, flattened 28*28) and labels (batch_size=2)
batch_size = 2
x = torch.randn(batch_size, 28 * 28)
y = torch.randint(0, 10, (batch_size,))
batch = (x, y)

ARGS = {
    'batch': batch,
    'batch_idx': 0,
    'logger': SimpleLogger()
}

METHOD = 'training_step'
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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)
MINE_DV Ran
ran on a synthesized input
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("082cb8e36b191938")
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 1, dtype family float, shape (1,) 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
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Function
import math

class StatisticsNet(nn.Module):
    """
    Network for estimating mutual information between two random variables
    """

    def __init__(self, x_dim, z_dim):
        super().__init__()
        self._layers = nn.ModuleList()
        self._layers.append(nn.Linear(x_dim + z_dim, 512))
        self._layers.append(nn.Linear(512, 512))
        self._out_layer = nn.Linear(512, 1)
        self._initialize_weights()

    def _initialize_weights(self):
        for name, param in self._layers.named_parameters():
            if 'weight' in name:
                nn.init.kaiming_normal_(param, nonlinearity='relu')
            elif 'bias' in name:
                nn.init.zeros_(param)
        for name, param in self._out_layer.named_parameters():
            if 'weight' in name:
                nn.init.kaiming_normal_(param, nonlinearity='linear')
            elif 'bias' in name:
                nn.init.zeros_(param)

    def forward(self, x, z):
        x = torch.cat([x, z], dim=1)
        x = x + 0.3 * torch.randn_like(x)
        for hid_layer in self._layers:
            x = F.elu(hid_layer(x))
            x = x + 0.5 * torch.randn_like(x)
        return self._out_layer(x)

class UnbiasedLogMeanExp(Function):
    """
    Calculates and uses gradients with reduced bias
    """
    epsilon = 1e-06

    @staticmethod
    def forward(ctx, i, ema):
        ctx.save_for_backward(i, ema)
        mean_numel = torch.tensor(i.shape[0], dtype=torch.float)
        output = i.logsumexp(dim=0).subtract(torch.log(mean_numel))
        return output

    @staticmethod
    def backward(ctx, grad_output):
        i, ema = ctx.saved_tensors
        grad_i = grad_ema = None
        mean_numel = torch.tensor(i.shape[0], dtype=torch.float)
        grad_i = grad_output * (i.exp() / ((ema + UnbiasedLogMeanExp.epsilon) * mean_numel))
        return (grad_i, grad_ema)

class MINE_Base(nn.Module):

    def __init__(self, input_dim, K, est_lr=0.0002, variant='unbiased'):
        super().__init__()
        self._T = StatisticsNet(input_dim, K)
        self._est_lr = est_lr
        self.variant = variant
        self._current_epoch = 0

    def _configure_optimizers(self):
        opt = optim.Adam(self._T.parameters(), lr=self._est_lr, betas=(0.5, 0.999))
        sch = None
        return (opt, sch)

    def step_epoch(self):
        self._current_epoch += 1

class MINE_DV(MINE_Base):
    _ANNEAL_PERIOD = 0
    _EMA_ANNEAL_PERIOD = 0

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._decay = 0.994
        self._ema = None

    def _update_ema(self, t_margin):
        with torch.no_grad():
            exp_t = t_margin.exp().mean(dim=0)
            if self._ema is not None:
                self._ema = self._decay * self._ema + (1 - self._decay) * exp_t
            else:
                self._ema = exp_t

    def get_mi_bound(self, x, z, z_margin=None, update_ema=False):
        t_joint = self._T(x, z).mean(dim=0)
        if z_margin is not None:
            t_margin = self._T(x, z_margin)
        else:
            t_margin = self._T(x, z[torch.randperm(x.shape[0])])
        if (self.variant == 'unbiased' and update_ema) and self._current_epoch > self._EMA_ANNEAL_PERIOD:
            self._update_ema(t_margin)
        if self.variant == 'unbiased' and self._current_epoch > self._ANNEAL_PERIOD:
            log_exp_t = UnbiasedLogMeanExp.apply(t_margin, self._ema)
        else:
            log_exp_t = t_margin.logsumexp(dim=0).subtract(math.log(x.shape[0]))
        return t_joint - log_exp_t

INIT_ARGS = {
    'input_dim': 4,
    'K': 3,
    'est_lr': 0.0002,
    'variant': 'unbiased'
}

ARGS = {
    'x': torch.randn(2, 4),
    'z': torch.randn(2, 3),
    'z_margin': None,
    'update_ema': True
}

METHOD = 'get_mi_bound'

if __name__ == '__main__':
    model = MINE_DV(**INIT_ARGS)
    result = model.get_mi_bound(**ARGS)
    print(f"MI bound result: {result}")
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 1, dtype family float, shape (1,) — shape (1,) 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)
MINE_f_Div Ran
ran on a synthesized input
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("8ebee944cb23e1ea")
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 1, dtype family float, shape (1,) 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
import torch.optim as optim
import torch.nn.functional as F

class StatisticsNet(nn.Module):
    """
    Network for estimating mutual information between two random variables
    """

    def __init__(self, x_dim, z_dim):
        super().__init__()
        self._layers = nn.ModuleList()
        self._layers.append(nn.Linear(x_dim + z_dim, 512))
        self._layers.append(nn.Linear(512, 512))
        self._out_layer = nn.Linear(512, 1)
        self._initialize_weights()

    def _initialize_weights(self):
        for name, param in self._layers.named_parameters():
            if 'weight' in name:
                nn.init.kaiming_normal_(param, nonlinearity='relu')
            elif 'bias' in name:
                nn.init.zeros_(param)
        for name, param in self._out_layer.named_parameters():
            if 'weight' in name:
                nn.init.kaiming_normal_(param, nonlinearity='linear')
            elif 'bias' in name:
                nn.init.zeros_(param)

    def forward(self, x, z):
        x = torch.cat([x, z], dim=1)
        x = x + 0.3 * torch.randn_like(x)
        for hid_layer in self._layers:
            x = F.elu(hid_layer(x))
            x = x + 0.5 * torch.randn_like(x)
        return self._out_layer(x)

class MINE_Base(nn.Module):

    def __init__(self, input_dim, K, est_lr=0.0002, variant='unbiased'):
        super().__init__()
        self._T = StatisticsNet(input_dim, K)
        self._est_lr = est_lr
        self.variant = variant
        self._current_epoch = 0

    def _configure_optimizers(self):
        opt = optim.Adam(self._T.parameters(), lr=self._est_lr, betas=(0.5, 0.999))
        sch = None
        return (opt, sch)

    def step_epoch(self):
        self._current_epoch += 1

class MINE_f_Div(MINE_Base):

    def get_mi_bound(self, x, z, z_margin=None, update_ema=False):
        t_joint = self._T(x, z).mean(dim=0)
        if z_margin is not None:
            t_margin = self._T(x, z_margin)
        else:
            t_margin = self._T(x, z[torch.randperm(x.shape[0])])
        exp_t = torch.mean(torch.exp(t_margin - 1), dim=0)
        return t_joint - exp_t

INIT_ARGS = {
    'input_dim': 4,
    'K': 3,
    'est_lr': 0.0002,
    'variant': 'unbiased'
}

ARGS = {
    'x': torch.randn(2, 4),
    'z': torch.randn(2, 3),
    'z_margin': None,
    'update_ema': False
}

METHOD = 'get_mi_bound'

if __name__ == '__main__':
    model = MINE_f_Div(**INIT_ARGS)
    result = model.get_mi_bound(**ARGS)
    print(f"Result shape: {result.shape}")
    print(f"Result: {result}")
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 1, dtype family float, shape (1,) — shape (1,) 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)
ToyNet Ran
ran on a synthesized input
shijing001/VIB_audio_classification/model.py
pointer only (licence: NONE) · get_code("2ed12f6fc688e30b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shijing001/VIB_audio_classification 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.

cuda Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from tj-kim/pfeddef_v1
pointer only · get_code("558fdb5c17a3a411")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

MINE_Classifier Not yet run
unverified (harvested, no recorded run)
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("187447efb5b50dcd")
How it ran

no invocation recorded.

NWJ Not yet run
unverified (harvested, no recorded run)
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("bc8c65f594872a4e")
How it ran

no invocation recorded.

PolyakAveraging Not yet run
unverified (harvested, no recorded run)
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("dea970c0f0d64aa9")
How it ran

no invocation recorded.

get_estimator Not yet run
unverified (harvested, no recorded run)
mohith-sakthivel/mine-pytorch/mine/ib.py
code served (permissive licence) · get_code("8a4051f92b92de6e")
How it ran

no invocation recorded.

xavier_init Not yet run
unverified (harvested, no recorded run)
shijing001/VIB_audio_classification/model.py
pointer only (licence: NONE) · get_code("1f17bea5c95190e2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, shijing001/VIB_audio_classification 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 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 9 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
cuda
brick of this paper's assembly: helper
2 other papers
2 later
2108.10252 (2021-08)
Federated Multi-Task Learning under a Mixture of Distributions
2402.03254 (2024-02)
Minimum Description Length and Generalization Guarantees for Representation Learning
MINE_DV
brick of this paper's assembly: loss
1 other paper
1 later
1801.04062 (2018-01)
MINE: Mutual Information Neural Estimation

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

We present a variational approximation to the information bottleneck of Tishby et al. (1999). This variational approach allows us to parameterize the information bottleneck model using a neural network and leverage the reparameterization trick for efficient training. We call this method "Deep Variational Information Bottleneck", or Deep VIB. We show that models trained with the VIB objective outperform those that are trained with other forms of regularization, in terms of generalization performance and robustness to adversarial attack.

For agents

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

get_harvested_code_for_paper("1612.00410")
get_code_for_paper("1612.00410")
have("1612.00410")

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

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

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

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

Connect an agent — have() is free.