SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.01629 · ICLR · 2023

Learning Group Importance using the Differentiable Hypergeometric Distribution

Thomas Sutter, Julia Vogt, Laura Manduchi, Alain Ryser

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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 5 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/2203.01629.json · badge: /api/ran/2203.01629.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
thomassutter/mvhg canonical (classifier label)
classifier basis: classifier_2025
6 ran · 5 no recorded run
FunctionStatusWhere it lives
calc_group_w_m Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("fc3dba973f801ca8")
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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small tensors with distinct dimensions for clarity
# m_group: shape (batch, groups, features) - let's use (2, 3, 4)
m_group = tf.constant(
    np.random.rand(2, 3, 4) + 0.1,  # Add 0.1 to avoid log(0)
    dtype=tf.float32
)

# log_w_group: shape (batch, groups, features) - same shape as m_group
log_w_group = tf.constant(
    np.random.randn(2, 3, 4),
    dtype=tf.float32
)

ARGS = {
    "m_group": m_group,
    "log_w_group": log_w_group,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
get_dataloader Ran
ran; our contract draft was wrong, not the code
thomassutter/mvhg/main_minimal_app.py
code served (permissive licence) · get_code("d30acb3cc58f6973")
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 tuple, ndim 1, 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 numpy as np

torch.manual_seed(0)

# Create samples: shape (10, 4) - 10 samples of dimension 4
samples = np.random.randn(10, 4).astype(np.float32)

# Create w_all: shape (3,) - weight vector of dimension 3
w_all = torch.randn(3)

# batch_size
batch_size = 2

ARGS = {
    "samples": samples,
    "w_all": w_all,
    "batch_size": batch_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
get_hside_check Ran
ran; our contract draft was wrong, not the code
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("76f62156d24e3bbe")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Set up TensorFlow 1.x compatibility mode
tf.compat.v1.disable_eager_execution()

# Create small test tensors
# The function expects tensors that will be used in arithmetic operations
# n: shape (2, 4) - batch size 2, dimension 4
# x_i: shape (2, 4) - same shape for element-wise operations
# m_r: shape (2, 4) - same shape for element-wise operations

n = tf.compat.v1.get_default_graph().get_tensor_by_name('n:0') if 'n:0' in [t.name for t in tf.compat.v1.get_default_graph().as_graph_def().node] else tf.constant(np.random.randn(2, 4).astype(np.float32), name='n')

x_i = tf.constant(np.random.randn(2, 4).astype(np.float32), name='x_i')
m_r = tf.constant(np.random.randn(2, 4).astype(np.float32), name='m_r')

# Create a fresh graph and tensors within it
graph = tf.compat.v1.Graph()
with graph.as_default():
    n = tf.constant(np.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=np.float32), name='n')
    x_i = tf.constant(np.array([[0.5, 1.5, 2.5, 3.5], [4.5, 5.5, 6.5, 7.5]], dtype=np.float32), name='x_i')
    m_r = tf.constant(np.array([[2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0]], dtype=np.float32), name='m_r')

ARGS = {
    'n': n,
    'x_i': x_i,
    'm_r': m_r
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
gumbel_softmax Ran
ran, honoured the contract we drafted
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("6145a3352a4a5eba")
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 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 tensorflow as tf

# Create small logits tensor: shape (batch=2, sequence=3, classes=4)
logits = tf.constant([
    [[1.0, 2.0, 0.5, 1.5], [0.8, 1.2, 2.1, 0.3], [1.1, 0.9, 1.3, 0.7]],
    [[2.0, 1.0, 1.5, 0.8], [0.5, 2.2, 1.1, 0.9], [1.4, 0.6, 0.8, 2.0]]
], dtype=tf.float32)

# Temperature for gumbel softmax
temp = 0.5

# hard parameter controls whether to use straight-through estimator
hard = True

# add_noise parameter controls whether to add gumbel noise
add_noise = True

ARGS = {
    "logits": logits,
    "temp": temp,
    "hard": hard,
    "add_noise": add_noise
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
heaviside Ran
ran; our contract draft was wrong, not the code
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("2d35babdf0eed62d")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# Enable eager execution for TF 2.x compatibility, or use TF 1.x style
tf.compat.v1.disable_eager_execution()

# Create a small test tensor
x_np = np.array([[-1.0, 0.5, -0.3, 1.2],
                  [0.0, -2.1, 0.8, -0.5]], dtype=np.float32)
x_tensor = tf.compat.v1.constant(x_np)

# Get the default graph
g = tf.compat.v1.get_default_graph()

ARGS = {
    'x': x_tensor,
    'g': g
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
sample_gumbel Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("e3b566f38adb8596")
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 EagerTensor, 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 tensorflow as tf

ARGS = {
    'shape': (2, 4),
    'eps': 1e-20
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py recorded SymbolicTensor ndim 2, which disagrees with the fixture run
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
create_data Not yet run
unverified (harvested, no recorded run)
thomassutter/mvhg/main_minimal_app.py
code served (permissive licence) · get_code("e9004c814450d0d7")
How it ran

no invocation recorded.

get_log_p_x_i Not yet run
unverified (harvested, no recorded run)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("8c62b9743c2ad649")
How it ran

no invocation recorded.

get_logits Not yet run
unverified (harvested, no recorded run)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("96e425bda34c91d8")
How it ran

no invocation recorded.

get_probability Not yet run
unverified (harvested, no recorded run)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("6b46f86f168667b7")
How it ran

no invocation recorded.

pmf_noncentral_fmvhg Not yet run
unverified (harvested, no recorded run)
thomassutter/mvhg/mvhg/tf_fmvhg.py
code served (permissive licence) · get_code("121b9b77441dfd95")
How it ran

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, 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 11 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

Partitioning a set of elements into subsets of a priori unknown sizes is essential in many applications. These subset sizes are rarely explicitly learned -be it the cluster sizes in clustering applications or the number of shared versus independent generative latent factors in weakly-supervised learning. Probability distributions over correct combinations of subset sizes are non-differentiable due to hard constraints, which prohibit gradient-based optimization. In this work, we propose the differentiable hypergeometric distribution. The hypergeometric distribution models the probability of different group sizes based on their relative importance. We introduce reparameterizable gradients to learn the importance between groups and highlight the advantage of explicitly learning the size of subsets in two typical applications: weakly-supervised learning and clustering. In both applications, we outperform previous approaches, which rely on suboptimal heuristics to model the unknown size of groups.

For agents

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

get_harvested_code_for_paper("2203.01629")
get_code_for_paper("2203.01629")
have("2203.01629")

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

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

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

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

Connect an agent — have() is free.