SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1906.08158 · 2019

BatchBALD: Efficient and Diverse Batch Acquisition for Deep Bayesian Active Learning

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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; 2 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/1906.08158.json · badge: /api/ran/1906.08158.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
BlackHC/batchbald_redux community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
blackhc/active_learning_redux reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
batch_multi_choices Ran
ran on a synthesized input
BlackHC/batchbald_redux/batchbald_redux/joint_entropy.py
code served (permissive licence) · get_code("513891b70f1ad822")
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 3, dtype family int, shape (2, 3, 5) 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)

# probs_b_C should be a probability distribution tensor
# Shape: Ni... x C, where C is the number of classes
# We'll create a tensor with shape (2, 3, 4) where:
# - 2 and 3 are batch dimensions (Ni...)
# - 4 is the number of classes (C)
probs_b_C = torch.rand(2, 3, 4)
probs_b_C = probs_b_C / probs_b_C.sum(dim=-1, keepdim=True)  # normalize to valid probabilities

# M is the number of samples to draw
M = 5

ARGS = {
    "probs_b_C": probs_b_C,
    "M": M,
}
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 3, dtype family int, shape (2, 3, 5) — shape (2, 3, 5) 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
freeze_encoder_context Ran
ran; our contract draft was wrong, not the code
blackhc/active_learning_redux/batchbald_redux/consistent_mc_dropout.py
code served (permissive licence) · get_code("5fc21e68455a065c")
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 no_grad. 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
from contextlib import nullcontext

torch.manual_seed(0)

ARGS = {
    "freeze_encoder": True
}
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 no_grad — a no_grad output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a no_grad 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
get_balanced_sample_indices Ran
ran on a synthesized input
BlackHC/batchbald_redux/batchbald_redux/active_learning.py
code served (permissive licence) · get_code("154e4e7701bd2b1e")
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 list, ndim 1, dtype family int; 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 collections

torch.manual_seed(0)

# Construct target_classes as a list of class labels
# For a balanced sampling scenario, we need multiple samples per class
# Let's create 10 samples distributed across 5 classes
target_classes = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4]

# Number of classes
num_classes = 5

# Number of samples to draw per class
n_per_digit = 2

ARGS = {
    "target_classes": target_classes,
    "num_classes": num_classes,
    "n_per_digit": n_per_digit,
}
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 list, ndim 1, dtype family int — a list 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_base_indices Ran
ran on a synthesized input
BlackHC/batchbald_redux/batchbald_redux/active_learning.py
code served (permissive licence) · get_code("cea0344b14945f61")
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 list, ndim 1, dtype family int; 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.utils.data as data

torch.manual_seed(0)

# Create a simple base dataset
class SimpleDataset(data.Dataset):
    def __init__(self, size=10):
        self.data = torch.randn(size, 4)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

# Create base dataset
base_dataset = SimpleDataset(size=10)

# Create a Subset from the base dataset
subset_indices = [1, 3, 5, 7, 9]
subset_dataset = data.Subset(base_dataset, subset_indices)

# Create another Subset from the first Subset (nested)
nested_subset_indices = [0, 2, 4]
nested_subset_dataset = data.Subset(subset_dataset, nested_subset_indices)

# Test indices to query
query_indices = [0, 1, 2]

ARGS = {
    "dataset": nested_subset_dataset,
    "indices": query_indices
}
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 list, ndim 1, dtype family int — a list 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_subset_base_indices Ran
ran on a synthesized input
BlackHC/batchbald_redux/batchbald_redux/active_learning.py
code served (permissive licence) · get_code("39cd43d20d53694d")
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 list, ndim 1, dtype family int; 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.utils.data as data
import numpy as np

torch.manual_seed(0)

# Create a simple dataset with some dummy data
class DummyDataset(data.Dataset):
    def __init__(self, size=10):
        self.size = size
    
    def __getitem__(self, idx):
        return torch.randn(4), idx
    
    def __len__(self):
        return self.size

# Create base dataset
base_dataset = DummyDataset(size=10)

# Create a Subset from the base dataset with some indices
subset_indices = [2, 4, 6, 8, 1]
subset_dataset = data.Subset(base_dataset, subset_indices)

# Create the indices to query from the subset
query_indices = [0, 2, 4]

ARGS = {
    "dataset": subset_dataset,
    "indices": query_indices
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list 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_targets Ran
ran on a synthesized input
BlackHC/batchbald_redux/batchbald_redux/repeated_mnist.py
code served (permissive licence) · get_code("33b880b8eba08094")
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 int, 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 torch.utils.data as data

torch.manual_seed(0)

class TransformedDataset(data.Dataset):
    """
    Transforms a dataset.

    Arguments:
        dataset (Dataset): The whole Dataset
        transformer (LambdaType): (idx, sample) -> transformed_sample
    """

    def __init__(self, dataset, *, transformer=None, vision_transformer=None):
        self.dataset = dataset
        assert not transformer or not vision_transformer
        if transformer:
            self.transformer = transformer
        else:
            self.transformer = lambda _, data_label: (vision_transformer(data_label[0]), data_label[1])

    def __getitem__(self, idx):
        return self.transformer(idx, self.dataset[idx])

    def __len__(self):
        return len(self.dataset)

def get_targets(dataset):
    """Get the targets of a dataset without any target transforms.

    This supports subsets and other derivative datasets."""
    if isinstance(dataset, TransformedDataset):
        return get_targets(dataset.dataset)
    if isinstance(dataset, data.Subset):
        targets = get_targets(dataset.dataset)
        return torch.as_tensor(targets)[dataset.indices]
    if isinstance(dataset, data.ConcatDataset):
        return torch.cat([get_targets(sub_dataset) for sub_dataset in dataset.datasets])
    return torch.as_tensor(dataset.targets)


# Create a simple base dataset
class SimpleDataset(data.Dataset):
    def __init__(self, size=2):
        self.data = torch.randn(size, 4)
        self.targets = torch.tensor([0, 1])
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]
    
    def __len__(self):
        return len(self.data)


# Test case 1: Simple dataset
simple_dataset = SimpleDataset(size=2)

# Test case 2: TransformedDataset
transformer_fn = lambda idx, sample: (sample[0] * 2, sample[1])
transformed_dataset = TransformedDataset(simple_dataset, transformer=transformer_fn)

# Test case 3: Subset
subset_dataset = data.Subset(simple_dataset, indices=[0, 1])

# Test case 4: ConcatDataset
dataset1 = SimpleDataset(size=2)
dataset2 = SimpleDataset(size=2)
concat_dataset = data.ConcatDataset([dataset1, dataset2])

ARGS = {
    "dataset": simple_dataset
}
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 int, 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
custom_doc_links Not yet run
unverified (harvested, no recorded run)
BlackHC/batchbald_redux/batchbald_redux/_nbdev.py
code served (permissive licence) · get_code("c00f1d9594b0678a")
How it ran

no invocation recorded.

gather_expand Not yet run
unverified (harvested, no recorded run)
BlackHC/batchbald_redux/batchbald_redux/joint_entropy.py
code served (permissive licence) · get_code("4b7d9618e1c8a935")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
custom_doc_links 9 other papers
4 dated earlier, 5 later
1403.6652 (2014-03)
DeepWalk: Online Learning of Social Representations
1604.07143 (2016-04)
Neural Random Forests
1812.08693 (2018-12)
An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation
and 6 more not named here

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 develop BatchBALD, a tractable approximation to the mutual information between a batch of points and model parameters, which we use as an acquisition function to select multiple informative points jointly for the task of deep Bayesian active learning. BatchBALD is a greedy linear-time $1 - \frac{1}{e}$-approximate algorithm amenable to dynamic programming and efficient caching. We compare BatchBALD to the commonly used approach for batch data acquisition and find that the current approach acquires similar and redundant points, sometimes performing worse than randomly acquiring data. We finish by showing that, using BatchBALD to consider dependencies within an acquisition batch, we achieve new state of the art performance on standard benchmarks, providing substantial data efficiency improvements in batch acquisition.

For agents

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

get_harvested_code_for_paper("1906.08158")
get_code_for_paper("1906.08158")
have("1906.08158")

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

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

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

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

Connect an agent — have() is free.