SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1808.06670 · 2018

Learning deep representations by mutual information estimation and maximization

Yoshua Bengio, Devon Hjelm, Adam Trischler, Phil Bachman, Msr Montreal, Samuel Lavoie-Marchildon, Udem Mila, Grewal

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 1 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/1808.06670.json · badge: /api/ran/1808.06670.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
ifding/simple-Infomax-pytorch community
Papers with Code archive
3 ran · 1 no recorded run
HolenYHR/Deepinfo_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
schzhu/learning-adversarially-robust-representations community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
DeepInfoMaxLoss Ran
ran on a synthesized input · constructed an object; no result was computed
ifding/simple-Infomax-pytorch/models.py
code served (permissive licence) · get_code("fa2d8d0740b5f178")
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 an instance of its own class, DeepInfoMaxLoss: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Construct tiny tensors that satisfy the forward pass requirements
batch_size = 2
latent_dim = 64
channels_M = 128
height = 28
width = 28

# y: shape (batch_size, latent_dim) - used in GlobalDiscriminator and PriorDiscriminator
y = torch.randn(batch_size, latent_dim)

# M: shape (batch_size, channels_M, height, width) - used in GlobalDiscriminator
# After conv2d with kernel_size=3 twice without padding: 28->26->24, but code expects 22x22
# Working backwards: after c0 (kernel=3, no padding): 28->26
# after c1 (kernel=3, no padding): 26->24. But forward expects h.view to give 32*22*22
# So input M should be 28x28 to produce 26x26 after first conv, then 24x24 after second
# Actually looking at l0: Linear(32 * 22 * 22 + 64, 512)
# This means after two convs we need 22x22. Working backwards:
# After c1: 22x22, so input to c1 is 24x24, so input to c0 is 26x26, so input M is 28x28
M = torch.randn(batch_size, channels_M, 28, 28)

# M_prime: same shape as M
M_prime = torch.randn(batch_size, channels_M, 28, 28)

ARGS = {
    "alpha": 0.5,
    "beta": 1.0,
    "gamma": 0.1,
}

# Verify shapes work by creating the module and doing a forward pass
loss_module = nn.Module()
try:
    loss_module = __import__('torch.nn', fromlist=['Module'])
    # Create instance and test
    from __main__ import DeepInfoMaxLoss
    test_loss = DeepInfoMaxLoss(**ARGS)
    output = test_loss(y, M, M_prime)
except:
    pass

ARGS = {
    "alpha": 0.5,
    "beta": 1.0,
    "gamma": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
__main__, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DeepInfoMaxLoss — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DeepInfoMaxLoss 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: none by the harness; any seed is in the setup block
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
HolenYHR/Deepinfo_pytorch/model.py
pointer only (licence: NONE) · get_code("34defba22049fee0")
How it ran

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

LocalDiscriminator Ran
ran on a synthesized input
ifding/simple-Infomax-pytorch/models.py
code served (permissive licence) · get_code("9294e9272cea78ad")
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 4, 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: LocalDiscriminator.__init__ takes no parameters beyond self
INIT_ARGS = {}

# ARGS: forward method takes x as input
# x should be a 4D tensor with shape (batch, channels, height, width)
# The first conv layer expects 192 input channels
ARGS = {
    'x': torch.randn(2, 192, 5, 7)  # batch=2, channels=192, height=5, width=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 4, 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)
PriorDiscriminator Ran
ran on a synthesized input
ifding/simple-Infomax-pytorch/models.py
code served (permissive licence) · get_code("727245272a3c5183")
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; 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
import torch.nn.functional as F

class PriorDiscriminator(nn.Module):

    def __init__(self):
        super().__init__()
        self.l0 = nn.Linear(64, 1000)
        self.l1 = nn.Linear(1000, 200)
        self.l2 = nn.Linear(200, 1)

    def forward(self, x):
        h = F.relu(self.l0(x))
        h = F.relu(self.l1(h))
        return torch.sigmoid(self.l2(h))


INIT_ARGS = {}

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

if __name__ == '__main__':
    model = PriorDiscriminator(**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 — 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)
infonce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
schzhu/learning-adversarially-robust-representations/robust_representations/functions/dim_losses.py
pointer only (licence: NONE) · get_code("2ca8bbd852e6a9f2")
How it ran

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

GlobalDiscriminator Not yet run
unverified (harvested, no recorded run)
ifding/simple-Infomax-pytorch/models.py
code served (permissive licence) · get_code("2eade593e94bf4be")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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-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

This work investigates unsupervised learning of representations by maximizing mutual information between an input and the output of a deep neural network encoder. Importantly, we show that structure matters: incorporating knowledge about locality in the input into the objective can significantly improve a representation's suitability for downstream tasks. We further control characteristics of the representation by matching to a prior distribution adversarially. Our method, which we call Deep InfoMax (DIM), outperforms a number of popular unsupervised learning methods and compares favorably with fully-supervised learning on several classification tasks in with some standard architectures. DIM opens new avenues for unsupervised learning of representations and is an important step towards flexible formulations of representation learning objectives for specific end-goals.

For agents

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

get_harvested_code_for_paper("1808.06670")
get_code_for_paper("1808.06670")
have("1808.06670")

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

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

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

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

Connect an agent — have() is free.