SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.01803 · 2018

ECC: Platform-Independent Energy-Constrained Deep Neural Network Compression via a Bilinear Regression Model

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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 7 have no contract verdict; 1 failure of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1812.01803.json · badge: /api/ran/1812.01803.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
hyang1990/energy_constrained_compression community (classifier label)
classifier basis not recorded on the link
8 ran · 4 no recorded run
zhanhuijing/ECC_PYCHARM reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
class_balance_holdout Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/utils.py
code served (permissive licence) · get_code("57446e55a345c5b8")
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.utils.data

torch.manual_seed(0)

class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, n_samples=50, n_classes=3):
        self.n_samples = n_samples
        self.n_classes = n_classes
        self.data = torch.randn(n_samples, 4)
        self.labels = torch.randint(0, n_classes, (n_samples,))
    
    def __len__(self):
        return self.n_samples
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx].item()

train_dataset = SimpleDataset(n_samples=50, n_classes=3)

ARGS = {
    "train_dataset": train_dataset,
    "n_classes": 3,
    "batch_size": 4,
    "num_workers": 0,
    "n_sample4class": 10
}
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
filter_projection_common Ran
ran; our contract draft was wrong, not the code
zhanhuijing/ECC_PYCHARM/net_adapt.py
code served (permissive licence) · get_code("834a15408eff8330")
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 SimpleModel. 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)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Create a small model with multiple layers
        # Layer 0: weight shape (8, 4) - output_width=8, input_width=4
        self.conv1 = nn.Conv2d(4, 8, kernel_size=3, padding=1)
        # Layer 1: weight shape (16, 8, 3, 3) - output_width=16, input_width=8
        self.conv2 = nn.Conv2d(8, 16, kernel_size=3, padding=1)
        # Layer 2: weight shape (10, 16) - output_width=10, input_width=16
        self.fc = nn.Linear(16, 10)
    
    def forward(self, x):
        return x

model = SimpleModel()

# The function iterates through named_parameters() looking for weights with dim > 1
# It maintains last_output_width which is p.size(0) for each weight layer found
# For layer_idx=1 (second weight layer found):
#   - conv1.weight: size (8, 4), output=8, input=4
#   - conv2.weight: size (16, 8, 3, 3), output=16, input=8
# We want to filter conv2 (layer_idx=1) with num_filters=6
# This means we want to keep 6 filters and zero out 16-6=10 filters

layer_idx = 1
num_filters = 6

ARGS = {
    "model": model,
    "layer_idx": layer_idx,
    "num_filters": num_filters,
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
is_image Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/cityscapes.py
code served (permissive licence) · get_code("48024d1a7659869b")
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 bool, 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

ARGS = {
    'filename': 'image.jpg'
}
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 bool, 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
is_label Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/cityscapes.py
code served (permissive licence) · get_code("8021631fe7e194d3")
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 bool, 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

torch.manual_seed(0)

ARGS = {
    "filename": "image_labelTrainIds.png"
}
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 bool, 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
load_image Ran
ran, honoured the contract we drafted
hyang1990/energy_constrained_compression/cityscapes.py
code served (permissive licence) · get_code("1c803ce4388e0644")
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 PngImageFile. 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 io
from PIL import Image

# Create a small in-memory image file
img = Image.new('RGB', (10, 10), color='red')
img_bytes = io.BytesIO()
img.save(img_bytes, format='PNG')
img_bytes.seek(0)

ARGS = {
    'file': img_bytes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PngImageFile — a PngImageFile output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PngImageFile output the recorded ndim 3 and dtype family int 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
load_obj Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/utils.py
code served (permissive licence) · get_code("5546eb177277a59a")
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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_filepath = os.path.join(temp_dir, "test_object.pkl")

# Create a simple object to pickle
test_object = {
    "data": [1, 2, 3, 4],
    "name": "test",
    "nested": {"key": "value"}
}

# Write the object to a pickle file
with open(temp_filepath, 'wb') as f:
    pickle.dump(test_object, f)

ARGS = {
    "filepath": temp_filepath
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
load_pickle Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/misc.py
code served (permissive licence) · get_code("06f17188ba319e44")
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 os
import pickle as pkl
import tempfile

# Create a temporary directory and a pickle file to load
temp_dir = tempfile.mkdtemp()
temp_pickle_path = os.path.join(temp_dir, 'test_data.pkl')

# Create a simple test object and pickle it
test_data = {'key': 'value', 'number': 42, 'list': [1, 2, 3]}
with open(temp_pickle_path, 'wb') as f:
    pkl.dump(test_data, f)

ARGS = {
    'path': temp_pickle_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
model_based_energy_estimator Ran
ran, honoured the contract we drafted
zhanhuijing/ECC_PYCHARM/net_adapt.py
code served (permissive licence) · get_code("058ec3591d32f963")
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 float, shape (1,) 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)

class EnergyPredictor(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(1, 1)
    
    def forward(self, model_width):
        # Convert model_width to tensor if needed
        if not isinstance(model_width, torch.Tensor):
            model_width = torch.tensor([model_width], dtype=torch.float32)
        return self.linear(model_width)

energy_predictor = EnergyPredictor()

ARGS = {
    "model_width": 128,
    "energy_predictor": energy_predictor
}
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 float, shape (1,) — shape (1,) 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
myalexnet Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/pt_models.py
code served (permissive licence) · get_code("340c3344f5e5621d")
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 MyAlexNet. 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 = {
    'pretrained': False,
    'model_root': None,
}
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 MyAlexNet — a MyAlexNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MyAlexNet 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
simple_random_holdout Ran
ran on a synthesized input
hyang1990/energy_constrained_compression/utils.py
code served (permissive licence) · get_code("5553a550e4175097")
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
from torch.utils.data import Dataset
from torch.utils.data.sampler import SubsetRandomSampler, Sampler

torch.manual_seed(0)

class SubsetSequentialSampler(Sampler):
    """Samples elements sequentially from a given list of indices, without replacement.

    Arguments:
        indices (sequence): a sequence of indices
    """

    def __init__(self, indices):
        self.indices = indices

    def __iter__(self):
        return (self.indices[i] for i in range(len(self.indices)))

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

class SimpleDataset(Dataset):
    def __init__(self, size=100, n_classes=5):
        self.size = size
        self.n_classes = n_classes
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        x = torch.randn(4)
        y = idx % self.n_classes
        return x, y

train_dataset = SimpleDataset(size=100, n_classes=5)
n_classes = 5
batch_size = 4
num_workers = 0
n_sample4class = 10

ARGS = {
    "train_dataset": train_dataset,
    "n_classes": n_classes,
    "batch_size": batch_size,
    "num_workers": num_workers,
    "n_sample4class": n_sample4class,
}
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
check_idle_gpu Not yet run
unverified (harvested, no recorded run)
hyang1990/energy_constrained_compression/misc.py
code served (permissive licence) · get_code("d14afb7ffcad6298")
How it ran

no invocation recorded.

choose_num_filters Not yet run
unverified (harvested, no recorded run)
zhanhuijing/ECC_PYCHARM/net_adapt.py
code served (permissive licence) · get_code("cdf00853efe6f5b0")
How it ran

no invocation recorded.

customized_erfnet Not yet run
unverified (harvested, no recorded run)
hyang1990/energy_constrained_compression/erfnet_cp.py
code served (permissive licence) · get_code("499fe8a6c2dba2f4")
How it ran

no invocation recorded.

erfnet Not yet run
unverified (harvested, no recorded run)
hyang1990/energy_constrained_compression/erfnet_cp.py
code served (permissive licence) · get_code("e52770fc4d56633a")
How it ran

no invocation recorded.

hold_gpu Not yet run
unverified (harvested, no recorded run)
hyang1990/energy_constrained_compression/misc.py
code served (permissive licence) · get_code("36b40f1824fd9d01")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
is_image 1 other paper
1 dated earlier
1606.02147 (2016-06)
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation
is_label 1 other paper
1 dated earlier
1606.02147 (2016-06)
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation
load_image 1 other paper
1 dated earlier
1606.02147 (2016-06)
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation
load_pickle 1 other paper
1 dated earlier
1806.00088 (2018-06)
PeerNets: Exploiting Peer Wisdom Against Adversarial Attacks

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

Many DNN-enabled vision applications constantly operate under severe energy constraints such as unmanned aerial vehicles, Augmented Reality headsets, and smartphones. Designing DNNs that can meet a stringent energy budget is becoming increasingly important. This paper proposes ECC, a framework that compresses DNNs to meet a given energy constraint while minimizing accuracy loss. The key idea of ECC is to model the DNN energy consumption via a novel bilinear regression function. The energy estimate model allows us to formulate DNN compression as a constrained optimization that minimizes the DNN loss function over the energy constraint. The optimization problem, however, has nontrivial constraints. Therefore, existing deep learning solvers do not apply directly. We propose an optimization algorithm that combines the essence of the Alternating Direction Method of Multipliers (ADMM) framework with gradient-based learning algorithms. The algorithm decomposes the original constrained optimization into several subproblems that are solved iteratively and efficiently. ECC is also portable across different hardware platforms without requiring hardware knowledge. Experiments show that ECC achieves higher accuracy under the same or lower energy budget compared to state-of-the-art resource-constrained DNN compression techniques.

For agents

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

get_harvested_code_for_paper("1812.01803")
get_code_for_paper("1812.01803")
have("1812.01803")

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

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

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

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

Connect an agent — have() is free.