EQODEC
EQODEC is a lightweight Python package that provides carbon-aware loss functions and energy-efficiency evaluation metrics for neural compression and representation learning systems.
It enables researchers and engineers to explicitly account for carbon cost during model training and evaluation, rather than treating emissions as a post-hoc reporting metric.
Motivation
The rapid growth of neural compression, generative models, and large-scale inference has significantly increased the energy and carbon footprint of data storage and transmission systems. While existing codecs optimize for rate-distortion trade-offs, they do not account for environmental impact during training or inference.
EQODEC addresses this gap by:
- Integrating carbon awareness directly into the training objective
- Providing a standardized Energy-Efficiency Score (EES) for fair evaluation
- Remaining model-agnostic and framework-lightweight
Key Features
-
Carbon-Aware Loss Function
- Drop-in replacement for standard rate-distortion losses
- Supports reconstruction, bitrate, and carbon regularization terms
-
Energy-Efficiency Score (EES)
- Quantifies storage savings per unit carbon cost
- Suitable for neural codecs, traditional codecs, and hybrid pipelines
-
Framework-Agnostic Design
- Works with any neural compression architecture
- Minimal assumptions about latent representations
-
CodeCarbon Integration
- Uses real-world carbon intensity estimates
- Graceful fallback when regional data is unavailable
Installation
pip install eqodec
Requirements
- Python>=3.8
- PyTorch
- NumPy
- CodeCarbon
Quick Start
1. Carbon-Aware Loss Function
import torch
from eqodec import CarbonAwareLoss, get_local_carbon_intensity
carbon_intensity = get_local_carbon_intensity()
criterion = CarbonAwareLoss(
lambda_recon=5.0,
lambda_rate=0.5,
lambda_carbon=0.005,
carbon_intensity=carbon_intensity
)
loss, metrics = criterion(x_hat, x, latent)
2. Energy-Efficiency Score (EES)
from eqodec import energy_efficiency_score
ees = energy_efficiency_score(
baseline_bytes=2.3e9,
compressed_bytes=1.9e9,
kg_co2=0.82
)
Higher values indicate more sustainable compression.
Use Cases
- Neural image, video, and audio compression
- Learned entropy models and autoencoders
- Carbon-aware representation learning
- Sustainability benchmarking of codecs
- Research on green AI and efficient ML systems
Design Philosophy
EQODEC is intentionally:
- Minimal - no datasets, no training loops
- Composable - integrates into existing pipelines
- Transparent - interpretable loss components
- Research-first - aligned with reproducible evaluation
Metadata
Release files for eqodec 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eqodec-0.4.0.tar.gz | 3.6 kB | Without provenance | Details for eqodec-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eqodec-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for eqodec-0.4.0-py3-none-any.whl |
Total release size: 7.7 kB
Release files / eqodec-0.4.0.tar.gz
| Download URL | eqodec-0.4.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
310b74a3f4fba4527ad2680773b6ed770734a72ee99b548414571b1ac845018e
|
|
BLAKE2b-256 checksum How to use checksums |
afa365772a46d06131e52d9b4eee817dadb4e2f0a418ef71e22a19edd2edbfc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / eqodec-0.4.0-py3-none-any.whl
| Download URL | eqodec-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
001e0177897a1dc62b987e48eac90a103a6f039cbb8d25278a537587ec0d627d
|
|
BLAKE2b-256 checksum How to use checksums |
620d23db1091d2dab2bc9ac25d91dd8fa5621b57aeb1515c5a93eab277b312ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for eqodec 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.