SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.01212 · 2022

AutoBalance: Optimized Loss Functions for Imbalanced Data

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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; 4 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 4 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/2201.01212.json · badge: /api/ran/2201.01212.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
ucr-optml/autobalance canonical (classifier label)
classifier basis not recorded on the link
10 ran · 4 no recorded run
FunctionStatusWhere it lives
ResNet20 Ran
ran on a synthesized input
ucr-optml/autobalance/models/ResNet.py
code served (permissive licence) · get_code("a299832f4fcf0211")
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

torch.manual_seed(0)

ARGS = {
    "num_classes": 10,
    "BN": True,
}
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
ResNet32 Ran
ran on a synthesized input
ucr-optml/autobalance/models/ResNet.py
code served (permissive licence) · get_code("80b1b62fc8826034")
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

torch.manual_seed(0)

ARGS = {
    "num_classes": 10,
    "BN": True,
}
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
ResNet44 Ran
ran on a synthesized input
ucr-optml/autobalance/models/ResNet.py
code served (permissive licence) · get_code("ec1ce8e626c3703d")
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

torch.manual_seed(0)

ARGS = {
    'num_classes': 10,
    'BN': True,
}
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
default_loader Ran
ran, honoured the contract we drafted
ucr-optml/autobalance/dataset/iNaturalist.py
pointer only (licence: MIT); the stored copy get_code serves, from xlgsyzp/cvpt, is pointer only (licence: NONE) · get_code("ac269a0e4b8d946e")
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 xlgsyzp/cvpt, 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.

drop_connect Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ucr-optml/autobalance/models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from yoctta/multiple-attention, is pointer only (licence: NONE) · get_code("2dd5dfa94542911e")
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 yoctta/multiple-attention, 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.

gather_flat_grad Ran
ran, honoured the contract we drafted
ucr-optml/autobalance/core/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Tarzanagh/FedNest, is pointer only (licence: NONE) · get_code("739afdca8b2d673a")
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 Tarzanagh/FedNest, 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.

load_taxonomy Ran
ran on a synthesized input
ucr-optml/autobalance/dataset/iNaturalist.py
code served (permissive licence) · get_code("cac75c3f585e4df2")
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 numpy as np

# Construct ann_data with categories containing taxonomic information
ann_data = {
    'categories': [
        {'level1': 'A', 'level2': 'X'},
        {'level1': 'B', 'level2': 'Y'},
        {'level1': 'A', 'level2': 'Y'},
    ]
}

# Define taxonomy levels to extract
tax_levels = ['level1', 'level2']

# Define classes - these are indices into the categories
classes = np.array([0, 1, 2, 0, 1])

ARGS = {
    'ann_data': ann_data,
    'tax_levels': tax_levels,
    'classes': classes,
}
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 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
neumann_hyperstep_preconditioner Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ucr-optml/autobalance/core/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Tarzanagh/FedNest, is pointer only (licence: NONE) · get_code("085767456c708d9d")
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 Tarzanagh/FedNest, 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.

round_filters Ran
ran, honoured the contract we drafted
ucr-optml/autobalance/models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from yoctta/multiple-attention, is pointer only (licence: NONE) · get_code("826e2e91d6a9ec09")
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 yoctta/multiple-attention, 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.

round_repeats Ran
ran, honoured the contract we drafted
ucr-optml/autobalance/models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from yoctta/multiple-attention, is pointer only (licence: NONE) · get_code("4d8e794b593d34a0")
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 yoctta/multiple-attention, 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.

eval_epoch Not yet run
unverified (harvested, no recorded run)
ucr-optml/autobalance/core/trainer.py
code served (permissive licence) · get_code("41d10ece707b44af")
How it ran

no invocation recorded.

load_cifar10 Not yet run
unverified (harvested, no recorded run)
ucr-optml/autobalance/dataset/cifar10.py
code served (permissive licence) · get_code("8bf3be98e6cb32cb")
How it ran

no invocation recorded.

load_cifar100 Not yet run
unverified (harvested, no recorded run)
ucr-optml/autobalance/dataset/cifar100.py
code served (permissive licence) · get_code("297d16d00bf739bb")
How it ran

no invocation recorded.

loss_adjust_cross_entropy Not yet run
unverified (harvested, no recorded run)
ucr-optml/autobalance/core/utils.py
code served (permissive licence) · get_code("1025abdbfd524442")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 6 later) and 8 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
round_filters 31 other papers
18 dated earlier, 1 the same month, 12 later · 3 only as an assembly brick
1808.08127 (2018-08)
Recalibrating Fully Convolutional Networks with Spatial and Channel 'Squeeze & Excitation' Blocks
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
and 28 more not named here
round_repeats 30 other papers
19 dated earlier, 1 the same month, 10 later · 3 only as an assembly brick
1808.08127 (2018-08)
Recalibrating Fully Convolutional Networks with Spatial and Channel 'Squeeze & Excitation' Blocks
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
and 27 more not named here
default_loader 27 other papers
14 dated earlier, 13 later
1710.03463 (2017-10)
Learning to Generalize: Meta-Learning for Domain Generalization
1803.08669 (2018-03)
Pyramid Stereo Matching Network
1810.11408 (2018-10)
Anytime Stereo Image Depth Estimation on Mobile Devices
and 24 more not named here
drop_connect 15 other papers
12 dated earlier, 3 later · 2 only as an assembly brick
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
1911.09070 (2019-11)
EfficientDet: Scalable and Efficient Object Detection
1912.06218 (2019-12)
YOLACT++: Better Real-time Instance Segmentation
and 12 more not named here
gather_flat_grad 2 other papers
1 dated earlier, 1 later
1911.02590 (2019-11)
Optimizing Millions of Hyperparameters by Implicit Differentiation
2205.02215 (2022-05)
FEDNEST: Federated Bilevel, Minimax, and Compositional Optimization
neumann_hyperstep_preconditioner 2 other papers
1 dated earlier, 1 later
1911.02590 (2019-11)
Optimizing Millions of Hyperparameters by Implicit Differentiation
2205.02215 (2022-05)
FEDNEST: Federated Bilevel, Minimax, and Compositional 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

Imbalanced datasets are commonplace in modern machine learning problems. The presence of under-represented classes or groups with sensitive attributes results in concerns about generalization and fairness. Such concerns are further exacerbated by the fact that large capacity deep nets can perfectly fit the training data and appear to achieve perfect accuracy and fairness during training, but perform poorly during test. To address these challenges, we propose AutoBalance, a bi-level optimization framework that automatically designs a training loss function to optimize a blend of accuracy and fairness-seeking objectives. Specifically, a lower-level problem trains the model weights, and an upper-level problem tunes the loss function by monitoring and optimizing the desired objective over the validation data. Our loss design enables personalized treatment for classes/groups by employing a parametric cross-entropy loss and individualized data augmentation schemes. We evaluate the benefits and performance of our approach for the application scenarios of imbalanced and group-sensitive classification. Extensive empirical evaluations demonstrate the benefits of AutoBalance over state-of-the-art approaches. Our experimental findings are complemented with theoretical insights on loss function design and the benefits of train-validation split. All code is available open-source.

For agents

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

get_harvested_code_for_paper("2201.01212")
get_code_for_paper("2201.01212")
have("2201.01212")

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

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

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

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

Connect an agent — have() is free.