SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.19732 · NeurIPS · 2024

Unified Gradient-Based Machine Unlearning with Remain Geometry Enhancement

Xiaolin Huang, Tao Li, Haoran Wang, Zhehao Huang, Xinwen Cheng, Zhengbao He, Jinghao Zheng

arXiv · PDF · Open in the Atlas

Code that ran

17 of 26 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; 2 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 10 failures of our instrument; 9 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/2409.19732.json · badge: /api/ran/2409.19732.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
clear-nus/selective-amnesia canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
lioutang/unlearn-apollo-attack community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
OPTML-Group/Unlearn-Saliency community
Papers with Code archive
3 ran · 3 no recorded run
meghdadk/SCRUB community
Papers with Code archive
1 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
DistillLoss Ran
ran on a synthesized input
lioutang/unlearn-apollo-attack/unlearn/bad_teacher.py
code served (permissive licence) · get_code("3d829155d40ef755")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Build valid arguments for DistillLoss
batch_size = 2
num_classes = 4

outputs = torch.randn(batch_size, num_classes)
unlearn_labels = torch.randint(0, 2, (batch_size,)).float()
full_teacher_logits = torch.randn(batch_size, num_classes)
unlearning_teacher_logits = torch.randn(batch_size, num_classes)
KL_temperature = 3.0

ARGS = {
    "outputs": outputs,
    "unlearn_labels": unlearn_labels,
    "full_teacher_logits": full_teacher_logits,
    "unlearning_teacher_logits": unlearning_teacher_logits,
    "KL_temperature": KL_temperature,
}
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
GA Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("1b3f6a248551b312")
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 float, ndim 0, dtype family float; no output shape is stated. 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 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.optim as optim
import types as _types

torch.manual_seed(0)

class AverageMeter(object):
    """Computes and stores the average and current value"""

    def __init__(self):
        self.reset()

    def reset(self):
        self.val = 0
        self.avg = 0
        self.sum = 0
        self.count = 0

    def update(self, val, n=1):
        self.val = val
        self.sum += val * n
        self.count += n
        self.avg = self.sum / self.count


def accuracy(output, target, topk=(1,)):
    """Computes the precision@k for the specified values of k"""
    maxk = max(topk)
    batch_size = target.size(0)
    _, pred = output.topk(maxk, 1, True, True)
    pred = pred.t()
    correct = pred.eq(target.view(1, -1).expand_as(pred))
    res = []
    for k in topk:
        correct_k = correct[:k].view(-1).float().sum(0)
        res.append(correct_k.mul_(100.0 / batch_size))
    return res


def warmup_lr(epoch, step, optimizer, one_epoch_step, args):
    overall_steps = args.warmup * one_epoch_step
    current_steps = epoch * one_epoch_step + step
    lr = args.lr * current_steps / overall_steps
    lr = min(lr, args.lr)
    for p in optimizer.param_groups:
        p['lr'] = lr


utils = _types.SimpleNamespace(**{
    'AverageMeter': AverageMeter,
    'accuracy': accuracy,
    'warmup_lr': warmup_lr
})


class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.fc(x)


class SimpleCriterion(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, output, target):
        return nn.functional.cross_entropy(output, target)


train_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

model = SimpleModel()
criterion = SimpleCriterion()
optimizer = optim.SGD(model.parameters(), lr=0.01)

args = _types.SimpleNamespace(
    warmup=0,
    lr=0.01,
    print_freq=1
)

ARGS = {
    'train_loader': train_loader,
    'model': model,
    'criterion': criterion,
    'optimizer': optimizer,
    'epoch': 0,
    'args': args
}
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 float, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
GetImageFolderLoader Ran
ran; our contract draft was wrong, not the code
clear-nus/selective-amnesia/ddpm/classifier_evaluation.py
code served (permissive licence) · get_code("29136f2953d790e8")
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 DataLoader. 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 torchvision.transforms as transforms
from torch.utils.data import DataLoader
from PIL import Image
import pathlib
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory with a few small test images
temp_dir = tempfile.mkdtemp()

# Create a minimal valid PNG image
for i in range(2):
    img = Image.new('RGB', (8, 8), color=(i*100, i*100, i*100))
    img.save(os.path.join(temp_dir, f'test_{i}.png'))

ARGS = {
    'path': temp_dir,
    'data_type': 'png',
    'img_size': 4,
    'batch_size': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
batched_models_ Ran
ran on a synthesized input
lioutang/unlearn-apollo-attack/attacks/Apollo.py
code served (permissive licence) · get_code("2c9afdad86950b96")
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 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 torch.nn as nn
from torch.func import stack_module_state, functional_call

torch.manual_seed(0)

# Create a simple neural network module
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Create a list of models with the same architecture but different parameters
model1 = SimpleModel()
model2 = SimpleModel()
model3 = SimpleModel()

models_list = [model1, model2, model3]

ARGS = {
    "models_list": models_list
}
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 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_dataset_image_folder Ran
ran; our contract draft was wrong, not the code
clear-nus/selective-amnesia/ddpm/train_classifier.py
code served (permissive licence) · get_code("66de5a5babf9c9d8")
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 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 torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import tempfile
import os
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a temporary directory with fake image data
temp_dir = tempfile.mkdtemp()

# Create subdirectories for two classes
class_dir_1 = os.path.join(temp_dir, "class_1")
class_dir_2 = os.path.join(temp_dir, "class_2")
os.makedirs(class_dir_1, exist_ok=True)
os.makedirs(class_dir_2, exist_ok=True)

# Create some fake images
for i in range(5):
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(class_dir_1, f"image_{i}.png"))
    
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(class_dir_2, f"image_{i}.png"))

class Args:
    def __init__(self, data_path, batch_size):
        self.data_path = data_path
        self.batch_size = batch_size

ARGS = {
    "args": Args(data_path=temp_dir, batch_size=2)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — 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_idx_loaders Ran
ran on a synthesized input
lioutang/unlearn-apollo-attack/attack.py
code served (permissive licence) · get_code("323d03d62e0533c7")
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 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 torch.nn as nn
from collections import OrderedDict
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Create a minimal dataset class that has get_subset method
class MinimalDataset:
    def __init__(self, size=10):
        self.size = size
        self.data = torch.randn(size, 4)
        self.labels = torch.randint(0, 2, (size,))
    
    def get_subset(self, indices):
        # Return a TensorDataset for the given indices
        subset_data = self.data[indices]
        subset_labels = self.labels[indices]
        return TensorDataset(subset_data, subset_labels)

# Create dataset instance
dataset = MinimalDataset(size=12)

# Create split dictionary with indices
split = OrderedDict(
    unlearn=[0, 1, 2, 3],
    retain=[4, 5, 6, 7],
    test=[8, 9, 10, 11]
)

ARGS = {
    'split': split,
    'dataset': 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 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_timestep_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
clear-nus/selective-amnesia/ddpm/models/diffusion.py
code served (permissive licence) · get_code("cb49209c125de1b4")
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 Tensor, ndim 2, dtype family float, shape (2, 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
import math

torch.manual_seed(0)

# The function takes two parameters:
# 1. timesteps: a 1D tensor of timestep indices
# 2. embedding_dim: an integer specifying the embedding dimension

# Create a small 1D tensor of timesteps (batch size 2)
timesteps = torch.tensor([0, 5], dtype=torch.int64)

# Create an embedding dimension (use 4 as specified)
embedding_dim = 4

ARGS = {
    "timesteps": timesteps,
    "embedding_dim": embedding_dim,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
get_x_y_from_data_dict Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("c7ae957080f6f740")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors with distinct dimensions
x_tensor = torch.randn(2, 4)  # batch size 2, feature dim 4
y_tensor = torch.randn(2, 3)  # batch size 2, label dim 3

# Case 1: data_dict with tensors (not lists)
data_dict_tensors = {
    'x': x_tensor,
    'y': y_tensor
}

device = 'cpu'

ARGS = {
    'data': data_dict_tensors,
    'device': device
}
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 — 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
l2_penalty Ran
ran, honoured the contract we drafted
meghdadk/SCRUB/main_merged.py
pointer only (licence: NOASSERTION) · get_code("0885bc1a1a34f5eb")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, meghdadk/SCRUB (NOASSERTION). 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.

loss_function Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
clear-nus/selective-amnesia/vae/model.py
code served (permissive licence) · get_code("372b74ad7eb6ab5d")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Analyzing the function:
# - recon_x: used in binary_cross_entropy, needs shape compatible with x.view(-1, 784)
# - x: reshaped to (-1, 784), so needs total elements = batch_size * 784
# - mu: used in pow(2) and sum, needs same batch structure
# - log_var: used in sum, pow(2), exp(), needs same batch structure

# For a tiny example with batch size 2:
# - x should have shape (2, 784) when flattened, or (2, 28, 28) if we think of MNIST
# - recon_x should match x's flattened shape (2, 784)
# - mu should have shape (batch_size, latent_dim) 
# - log_var should have shape (batch_size, latent_dim)

batch_size = 2
latent_dim = 4
flattened_size = 784

# Create recon_x: reconstructed output from VAE decoder
# Shape: (batch_size, 784) with values in [0,1] for BCE
recon_x = torch.sigmoid(torch.randn(batch_size, flattened_size))

# Create x: original input, shape (batch_size, 784) with values in [0,1]
x = torch.rand(batch_size, flattened_size)

# Create mu: mean of latent distribution
# Shape: (batch_size, latent_dim)
mu = torch.randn(batch_size, latent_dim)

# Create log_var: log variance of latent distribution
# Shape: (batch_size, latent_dim)
log_var = torch.randn(batch_size, latent_dim)

ARGS = {
    "recon_x": recon_x,
    "x": x,
    "mu": mu,
    "log_var": log_var
}
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
noise_estimation_loss Ran
ran; our contract draft was wrong, not the code
clear-nus/selective-amnesia/ddpm/functions/losses.py
code served (permissive licence) · get_code("36a45cceb1209d2f")
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
import torch.nn as nn

torch.manual_seed(0)

# Define a simple model that takes (x, t) and outputs noise prediction
class NoisePredictor(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, t):
        # x shape: (batch, channels, height, width) = (2, 1, 1, 4)
        # t shape: (batch,) converted to float
        # output should match x shape
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        # t is (batch,), expand it to match
        t_expanded = t.unsqueeze(1)  # (batch, 1)
        combined = x_flat + t_expanded  # simple combination
        output = self.linear(combined)
        return output.view(batch_size, 1, 1, 4)

model = NoisePredictor()

# x0: original clean image, shape (batch=2, channels=1, height=1, width=4)
x0 = torch.randn(2, 1, 1, 4)

# t: timesteps, shape (batch=2,)
t = torch.LongTensor([0, 5])

# e: noise, same shape as x0
e = torch.randn(2, 1, 1, 4)

# b: betas (noise schedule), shape (num_timesteps,) - needs at least 6 elements for index 5
b = torch.linspace(0.0001, 0.02, 10)

ARGS = {
    "model": model,
    "x0": x0,
    "t": t,
    "e": e,
    "b": b,
    "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 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
nonlinearity Ran
ran; our contract draft was wrong, not the code
clear-nus/selective-amnesia/ddpm/models/diffusion.py
code served (permissive licence) · get_code("3137073275f8c21a")
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 Tensor, ndim 2, dtype family float, shape (2, 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 takes a single parameter 'x' which is used with:
# - multiplication operator (*)
# - torch.sigmoid() function
# This means x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
prob_mask_like Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
clear-nus/selective-amnesia/ddpm/models/diffusion.py
code served (permissive licence) · get_code("3c6433dd421724e0")
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 2, dtype family float, shape (2, 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 takes three parameters:
# - shape: a tuple defining the shape of the output tensor
# - prob: a float probability value (0, 1, or between 0 and 1)
# - device: a torch device

ARGS = {
    "shape": (2, 4),
    "prob": 0.5,
    "device": torch.device("cpu")
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
proj Ran
ran on a synthesized input
lioutang/unlearn-apollo-attack/attacks/Apollo.py
code served (permissive licence) · get_code("0d878f551236258c")
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 2, dtype family float, shape (2, 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)

# Create two small tensors for A and B
A = torch.randn(2, 4)
B = torch.randn(2, 4)

# Define r as a float value
r = 0.5

# Define type as a string ('in' or 'out')
type_param = 'in'

ARGS = {
    'A': A,
    'B': B,
    'r': r,
    'type': type_param
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
read_images_folder Ran
ran, honoured the contract we drafted
clear-nus/selective-amnesia/ddpm/evaluator.py
code served (permissive licence) · get_code("0bae0d076b1ae674")
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 ndarray, ndim 4, dtype family int, shape (3, 10, 10, 3) 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 os
import numpy as np
import tempfile
import cv2

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()

# Create a few small test images
for i in range(3):
    img = np.random.randint(0, 255, (10, 10, 3), dtype=np.uint8)
    img_path = os.path.join(temp_dir, f'test_image_{i}.png')
    cv2.imwrite(img_path, img)

ARGS = {
    'folder_path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family int, shape (3, 10, 10, 3) — shape (3, 10, 10, 3) 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
setminus Ran
ran on a synthesized input
lioutang/unlearn-apollo-attack/attack.py
code served (permissive licence) · get_code("f1ab27640c7765be")
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 ndarray, ndim 1, dtype family int, shape (3,) 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 numpy as np

# setminus takes two arguments: A and B
# Both should be array-like objects that can be converted to sets
# The function computes set difference: elements in A but not in B

A = np.array([1, 2, 3, 4, 5])
B = np.array([3, 4, 6, 7])

ARGS = {
    "A": A,
    "B": B
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (3,) — shape (3,) 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
validate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("def64f7467ecb30c")
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 float, ndim 0, dtype family float; no output shape is stated. 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 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

torch.manual_seed(0)

# Create a simple model that takes input and produces output
class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super(SimpleModel, self).__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create a simple criterion
criterion = nn.CrossEntropyLoss()

# Create a simple model
model = SimpleModel(input_dim=4, num_classes=3)

# Create validation loader with imagenet_arch path (dict-based data)
# This path expects data dicts with 'image' and 'label' or similar
val_loader_imagenet = [
    {'image': torch.randn(2, 4), 'label': torch.tensor([0, 1])},
    {'image': torch.randn(2, 4), 'label': torch.tensor([2, 0])},
]

# Create validation loader with non-imagenet path (tuple-based data)
val_loader_standard = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0])),
]

# Create args object with imagenet_arch=True
class Args:
    def __init__(self, imagenet_arch=False, print_freq=1):
        self.imagenet_arch = imagenet_arch
        self.print_freq = print_freq

args_imagenet = Args(imagenet_arch=True, print_freq=1)
args_standard = Args(imagenet_arch=False, print_freq=1)

# Use the standard path (non-imagenet) for this setup
ARGS = {
    'val_loader': val_loader_standard,
    'model': model,
    'criterion': criterion,
    'args': args_standard
}
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 float, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
GA_prune Not yet run
unverified (harvested, no recorded run)
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("28baf7f344ef0caa")
How it ran

no invocation recorded.

accuracy Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from snu-mllab/PuzzleMix
pointer only · get_code("f0c9a29156911331")
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. No invocation recorded.

all_but_one_class_dataset Not yet run
unverified (harvested, no recorded run)
clear-nus/selective-amnesia/ddpm/save_base_dataset.py
code served (permissive licence) · get_code("d278a27b738c2136")
How it ran

no invocation recorded.

batched_loss_ Not yet run
unverified (harvested, no recorded run)
lioutang/unlearn-apollo-attack/attacks/Apollo.py
code served (permissive licence) · get_code("900e51f145a62a95")
How it ran

no invocation recorded.

get_dataset Not yet run
unverified (harvested, no recorded run)
clear-nus/selective-amnesia/ddpm/train_classifier.py
code served (permissive licence) · get_code("403a67ad5e70ec17")
How it ran

no invocation recorded.

noise_estimation_loss_conditional Not yet run
unverified (harvested, no recorded run)
clear-nus/selective-amnesia/ddpm/functions/losses.py
code served (permissive licence) · get_code("657432e743b32d39")
How it ran

no invocation recorded.

run_epoch Not yet run
unverified (harvested, no recorded run)
meghdadk/SCRUB/main_merged.py
pointer only (licence: NOASSERTION) · get_code("9510c6df76e617f1")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, meghdadk/SCRUB (NOASSERTION). 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.

save_checkpoint Not yet run
unverified (harvested, no recorded run)
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("632b4796f64ea2f5")
How it ran

no invocation recorded.

warmup_lr Not yet run
unverified (harvested, no recorded run)
OPTML-Group/Unlearn-Saliency/Classification/unlearn/GA_prune.py
code served (permissive licence) · get_code("f1e544cbc00ca5fd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 26 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 2 the same month, 3 later) and 16 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
nonlinearity 156 other papers
102 dated earlier, 2 the same month, 48 later, 4 same year, order not determinable · 25 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 153 more not named here
get_timestep_embedding 91 other papers
74 dated earlier, 1 the same month, 12 later, 4 same year, order not determinable · 7 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 88 more not named here
accuracy
brick of this paper's assembly: helper
71 other papers
69 dated earlier, 2 later · 2 only as an assembly brick
1505.05424 (2015-05)
Weight Uncertainty in Neural Networks
1705.07204 (2017-05)
Ensemble Adversarial Training: Attacks and Defenses
1802.10399 (2018-02)
Compressing Neural Networks using the Variational Information Bottleneck
and 68 more not named here
noise_estimation_loss 14 other papers
13 dated earlier, 1 same year, order not determinable
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
2206.02262 (2022-06)
Diffusion-GAN: Training GANs with Diffusion
2211.14680 (2022-11)
A Physics-informed Diffusion Model for High-fidelity Flow Field Reconstruction
and 11 more not named here
prob_mask_like 11 other papers
9 dated earlier, 2 same year, order not determinable · 2 only as an assembly brick
2202.04200 (2022-02)
MaskGIT: Masked Generative Image Transformer
2209.04439 (2022-09)
Improved Masked Image Generation with Token-Critic
2211.10658 (2022-11)
EDGE: Editable Dance Generation From Music
and 8 more not named here
get_x_y_from_data_dict
brick of this paper's assembly: helper
4 other papers
4 dated earlier · 1 only as an assembly brick
2304.04934 (2023-04)
Model Sparsity Can Simplify Machine Unlearning
2310.18574 (2023-10)
Breaking the Trilemma of Privacy, Utility, Efficiency via Controllable Machine Unlearning
2401.06187 (2024-01)
Scissorhands: Scrub Data Influence via Connection Sensitivity in Networks
and 1 more not named here
GetImageFolderLoader 2 other papers
2 dated earlier
2401.05779 (2024-01)
Erasing Undesirable Influence in Diffusion Models
2402.11846 (2024-02)
UnlearnCanvas: Stylized Image Dataset for Enhanced Machine Unlearning Evaluation in Diffusion Models
all_but_one_class_dataset 2 other papers
2 dated earlier
2401.05779 (2024-01)
Erasing Undesirable Influence in Diffusion Models
2402.11846 (2024-02)
UnlearnCanvas: Stylized Image Dataset for Enhanced Machine Unlearning Evaluation in Diffusion Models
read_images_folder 2 other papers
2 dated earlier
2401.05779 (2024-01)
Erasing Undesirable Influence in Diffusion Models
2402.11846 (2024-02)
UnlearnCanvas: Stylized Image Dataset for Enhanced Machine Unlearning Evaluation in Diffusion Models
GA
brick of this paper's assembly: update_rule
1 other paper
1 dated earlier
2310.12508 (2023-10)
SalUn: Empowering Machine Unlearning via Gradient-based Weight Saliency in Both Image Classification and Generation

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

Machine unlearning (MU) has emerged to enhance the privacy and trustworthiness of deep neural networks. Approximate MU is a practical method for large-scale models. Our investigation into approximate MU starts with identifying the steepest descent direction, minimizing the output Kullback-Leibler divergence to exact MU inside a parameters' neighborhood. This probed direction decomposes into three components: weighted forgetting gradient ascent, fine-tuning retaining gradient descent, and a weight saliency matrix. Such decomposition derived from Euclidean metric encompasses most existing gradient-based MU methods. Nevertheless, adhering to Euclidean space may result in sub-optimal iterative trajectories due to the overlooked geometric structure of the output probability space. We suggest embedding the unlearning update into a manifold rendered by the remaining geometry, incorporating second-order Hessian from the remaining data. It helps prevent effective unlearning from interfering with the retained performance. However, computing the second-order Hessian for large-scale models is intractable. To efficiently leverage the benefits of Hessian modulation, we propose a fast-slow parameter update strategy to implicitly approximate the up-to-date salient unlearning direction. Free from specific modal constraints, our approach is adaptable across computer vision unlearning tasks, including classification and generation. Extensive experiments validate our efficacy and efficiency. Notably, our method successfully performs class-forgetting on ImageNet using DiT and forgets a class on CIFAR-10 using DDPM in just 50 steps, compared to thousands of steps required by previous methods. Code is available at Unified-Unlearning-w-Remain-Geometry.

For agents

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

get_harvested_code_for_paper("2409.19732")
get_code_for_paper("2409.19732")
have("2409.19732")

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

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

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

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

Connect an agent — have() is free.