SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.01934 · NeurIPS · 2022

Stochastic Multiple Target Sampling Gradient Descent

Nhat Ho, Dinh Phung, Trung Le, Toan Tran, Hoang Phan, Ngoc Tran

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 4 failures of our instrument; 0 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; 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/2206.01934.json · badge: /api/ran/2206.01934.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
isl-org/MultiObjectiveOptimization canonical (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
viethoang1512/mt-sgd canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
expected_calibration_error Ran
ran; our contract draft was wrong, not the code
viethoang1512/mt-sgd/celeba/multi_task/train_mt_sgd.py
pointer only (licence: NONE) · get_code("46e47135d4d407b3")
How it ran

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

conv3x3 Ran
ran; our contract draft was wrong, not the code
isl-org/MultiObjectiveOptimization/multi_task/models/pspnet.py
code served (permissive licence) · get_code("dbcb53696bc43ef9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Conv2d. 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)

# The function conv3x3 creates a Conv2d layer
# Parameters:
# - in_planes: number of input channels (int)
# - out_planes: number of output channels (int)
# - stride: stride for convolution (int, default=1)
# - has_bias: whether to use bias (bool, default=False)

ARGS = {
    'in_planes': 3,
    'out_planes': 8,
    'stride': 2,
    'has_bias': True
}
Setup block drafted by
a language model, Claude Sonnet 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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/models/resnet_mit.py
code served (permissive licence) · get_code("90e50bc6f1220bdd")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3_bn_relu Ran
ran; our contract draft was wrong, not the code
isl-org/MultiObjectiveOptimization/multi_task/models/pspnet.py
pointer only (licence: MIT); the stored copy get_code serves, from ZhengyaoFang/WeCromCL, is pointer only (licence: NONE) · get_code("fca7e85d958618dd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ZhengyaoFang/WeCromCL, and GitHub detected no licence in that repository 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.

cross_entropy2d Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/losses.py
code served (permissive licence) · get_code("36497fd5247322ab")
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)

# Create input tensor: (batch_size=2, channels=4, height=3, width=5)
# This is a 4D tensor as expected by the function
input_tensor = torch.randn(2, 4, 3, 5)

# Create target tensor: (batch_size=2, height=3, width=5)
# Values should be class indices (0-3 for 4 classes) or -1 for ignored pixels
target_tensor = torch.randint(0, 4, (2, 3, 5))
# Add some -1 values to test masking
target_tensor[0, 0, 0] = -1
target_tensor[1, 2, 4] = -1

# Create optional weight tensor for classes (one weight per class)
weight_tensor = torch.ones(4)

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "weight": weight_tensor,
    "val": 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
get_metrics Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/metrics.py
code served (permissive licence) · get_code("7adcc62e674f9a40")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'params': {
        'dataset': 'mnist',
        'tasks': ['task1', 'task2']
    }
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gradient_normalizers Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/min_norm_solvers.py
code served (permissive licence) · get_code("faa96c0ba935fc57")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct grads: dict mapping task names to lists of gradient tensors
# Each gradient tensor needs .pow(), .sum(), .data, .cpu() methods
grads = {
    'task_1': [torch.randn(2, 4, requires_grad=True), torch.randn(3, 4, requires_grad=True)],
    'task_2': [torch.randn(2, 4, requires_grad=True)],
}

# Construct losses: dict mapping task names to loss values (scalars)
losses = {
    'task_1': 0.5,
    'task_2': 0.3,
}

# Normalization type
normalization_type = 'l2'

ARGS = {
    'grads': grads,
    'losses': losses,
    'normalization_type': normalization_type,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
l1_loss_depth Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/losses.py
code served (permissive licence) · get_code("e870ff8870d18569")
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)

# Create small tensors for input and target
# The function expects tensors where target > 0 creates a mask
# input and target should have compatible shapes for element-wise operations
batch_size = 2
dim = 4

input_tensor = torch.randn(batch_size, dim)
target_tensor = torch.abs(torch.randn(batch_size, dim)) + 0.5  # Ensure target > 0

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "val": 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
nll Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/losses.py
code served (permissive licence) · get_code("a90eec2e662e141f")
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)

# Create small log-probability predictions
# F.nll_loss expects input of shape (N, C) where N is batch size, C is number of classes
# Input should be log probabilities (output of log_softmax)
batch_size = 2
num_classes = 4
pred = F.log_softmax(torch.randn(batch_size, num_classes), dim=1)

# Create target indices (class labels)
# F.nll_loss expects target of shape (N,) with values in [0, num_classes)
gt = torch.tensor([0, 2], dtype=torch.long)

# val parameter is a boolean flag
val = False

ARGS = {
    "pred": pred,
    "gt": gt,
    "val": val
}
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
resnet101 Ran
ran on a synthesized input
isl-org/MultiObjectiveOptimization/multi_task/models/resnet_mit.py
code served (permissive licence) · get_code("deddf757c7ef17c5")
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 ResNet. 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
import math

torch.manual_seed(0)

# Define ARGS dict with all parameters for resnet101
ARGS = {
    'pretrained': 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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
resnet50 Ran
ran; our contract draft was wrong, not the code
isl-org/MultiObjectiveOptimization/multi_task/models/resnet_mit.py
code served (permissive licence) · get_code("db1b66fff0c3985f")
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 ResNet. 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
import math

torch.manual_seed(0)

ARGS = {
    'pretrained': 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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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

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, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 2 later) and 1 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
conv3x3 7 other papers
5 dated earlier, 2 later
1804.08864 (2018-04)
Learning to See the Invisible: End-to-End Trainable Amodal Instance Segmentation
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
1807.11590 (2018-07)
Acquisition of Localization Confidence for Accurate Object Detection
and 4 more not named here
conv3x3_bn_relu 3 other papers
1 dated earlier, 2 later
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
2211.11208 (2022-11)
Next3D: Generative Neural Texture Rasterization for 3D-Aware Head Avatars
2407.19507 (2024-07)
WeCromCL: Weakly Supervised Cross-Modality Contrastive Learning for Transcription-only Supervised Text Spotting
resnet50 2 other papers
2 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
1908.05900 (2019-08)
Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network
conv3x3 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
cross_entropy2d 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
get_metrics 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
gradient_normalizers 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
l1_loss_depth 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
nll 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization
resnet101 1 other paper
1 dated earlier
1810.04650 (2018-10)
Multi-Task Learning as Multi-Objective Optimization

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

Sampling from an unnormalized target distribution is an essential problem with many applications in probabilistic inference. Stein Variational Gradient Descent (SVGD) has been shown to be a powerful method that iteratively updates a set of particles to approximate the distribution of interest. Furthermore, when analysing its asymptotic properties, SVGD reduces exactly to a single-objective optimization problem and can be viewed as a probabilistic version of this single-objective optimization problem. A natural question then arises: "Can we derive a probabilistic version of the multi-objective optimization?". To answer this question, we propose Stochastic Multiple Target Sampling Gradient Descent (MT-SGD), enabling us to sample from multiple unnormalized target distributions. Specifically, our MT-SGD conducts a flow of intermediate distributions gradually orienting to multiple target distributions, which allows the sampled particles to move to the joint highlikelihood region of the target distributions. Interestingly, the asymptotic analysis shows that our approach reduces exactly to the multiple-gradient descent algorithm for multi-objective optimization, as expected. Finally, we conduct comprehensive experiments to demonstrate the merit of our approach to multi-task learning.

For agents

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

get_harvested_code_for_paper("2206.01934")
get_code_for_paper("2206.01934")
have("2206.01934")

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

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

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

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

Connect an agent — have() is free.