ExpoNet
ExpoNet is a compact PyTorch library for dense numeric models with a trainable blend of ReLU and squared ReLU:
u = max(x, 0)
f(x; a) = (1 - a) * u + a * u * u
0 <= a <= 1
The primary activation uses one learned coefficient per hidden neuron. It uses multiplication and addition on activation values, not a general power. ExpoNet also provides scikit-learn-compatible dense regression and classification estimators with CPU or a single CUDA device.
Install
ExpoNet requires Python 3.11 or later, PyTorch, NumPy, and scikit-learn. Install the PyTorch build appropriate for your platform and GPU first, using the official PyTorch selector, then install this checkout:
python -m pip install .
For a checkout, install the project and its development tools with:
python -m pip install -e ".[dev]"
Package publication is not part of this release-readiness milestone; install a
built wheel locally with python -m pip install dist/exponet-0.1.0-py3-none-any.whl.
device="auto" uses CUDA when torch.cuda.is_available() is true, otherwise
CPU. device="cuda" or device="cuda:N" requires that device and raises if
it is unavailable; ExpoNet never silently falls back to CPU. A CUDA toolkit
compiler (nvcc) is not required for the prebuilt-PyTorch path.
Verified release-candidate coverage is Windows 11 CPU and CUDA on an NVIDIA GeForce RTX 5060 (PyTorch 2.11.0+cu128, CUDA runtime 12.8, Python 3.12.10, NumPy 2.5.2, scikit-learn 1.9.0). Linux has not yet been validated, so it is not claimed as supported coverage.
Quick start
import numpy as np
from exponet import ExpoRegressor
rng = np.random.default_rng(0)
X = rng.normal(size=(80, 2)).astype(np.float32)
y = (1.5 * X[:, 0] - 0.75 * X[:, 1] + 0.2).astype(np.float32)
model = ExpoRegressor(
hidden_dims=(8,),
normalization="none",
trainable_blend=False,
blend_init=0.0, # ReLU control
epochs=80,
lr=0.03,
device="auto",
random_state=0,
).fit(X, y)
predictions = model.predict(X[:3]) # shape: (3,)
print(model.device_, predictions)
The same verified examples are available for direct PyTorch use, regression, and multiclass classification.
Public API
| Export | Purpose | Output shape |
|---|---|---|
ExpoActivation |
Reusable PyTorch activation. | Same as input tensor. |
ExpoMLP |
Dense Linear -> optional LayerNorm -> ExpoActivation blocks and a linear readout. |
(batch, out_features) |
ExpoRegressor |
Dense numeric regression estimator. | predict: (N,) for 1-D targets, otherwise (N, K) |
ExpoClassifier |
Binary/multiclass integer or string-label estimator. | predict: (N,); predict_proba: (N, K) in classes_ order |
Both estimators accept dense finite numeric features shaped (N, F), train in
float32, provide fit, predict, score, get_blend_weights, and restricted
inference save/load methods. See the API contract
for constructor parameters, validation, scaling, early stopping, persistence,
and reproducibility semantics.
Scope and limitations
- This is a dense numeric-data library. Sparse inputs, missing values, categorical encoding, image/sequence architectures, sample/class weights, streaming, warm starts, AMP, compilation, distributed execution, and custom training hooks are outside this release.
- Classification accepts homogeneous integer or string labels only; continuous, mixed, multilabel, and multioutput labels are rejected.
- Float32 is the primary runtime dtype. CPU float64 is supported for low-level activation mathematics tests. Very large positive activations can overflow, particularly toward the squared-ReLU endpoint.
- Saved snapshots restore inference state only, not optimizer or RNG state; do not treat a loaded estimator as an exact training-resume checkpoint.
- The initial controlled evaluation did not show a consistent predictive advantage over native ReLU, so no superiority or universal-normalization claim is made. See the initial evaluation.
Development validation
python -B -m ruff format --check --no-cache --no-respect-gitignore src tests benchmarks examples
python -B -m ruff check --no-cache --no-respect-gitignore src tests benchmarks examples
python -B -m pytest -q -p no:cacheprovider
The roadmap records exact validation evidence and release scope. ExpoNet is available under the MIT License.
Design and evidence
| Document | Purpose |
|---|---|
| API contract | Implemented interfaces and exact behavior. |
| Design | Mathematics, numerical behavior, normalization, and architecture. |
| Decisions | Accepted scope and defaults. |
| Validation | Correctness checks and experimental criteria. |
| Initial evaluation | P6 five-seed activation comparison. |
| Activation timing | P1.04 CPU timing evidence and limitations. |
| PSANN reuse assessment | Selective adaptation provenance; no PSANN runtime dependency. |
| Roadmap | Completed work, release evidence, and deferred scope. |
Metadata
Release files for exponet 0.1.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 | |
|---|---|---|---|---|
| exponet-0.1.0.tar.gz | 32.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exponet-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.3 kB
Release files / exponet-0.1.0.tar.gz
| Download URL | exponet-0.1.0.tar.gz |
|---|---|
| Size | 32.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da2ce9832e30ebca83e93f75c3edf497879591029a400b632b590627ba844036
|
|
BLAKE2b-256 checksum How to use checksums |
b874adad6a01946f016a7498912b2718fe6fe19ffe1df931448f3a1dbbdee36b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / exponet-0.1.0-py3-none-any.whl
| Download URL | exponet-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e523a10c73fd310169db852a326738af6e2a43e4be56665fc8380a8afa36327a
|
|
BLAKE2b-256 checksum How to use checksums |
e28ab6e705cf46d9164daf8ddec2352a99b5becc4f2871d986bbe5037838fdc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for exponet 0.1.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.