SpectralNet: A Resolvent-Inspired Neural Architecture Based on Chernoff Approximations and Photonic Motivation
Sergey V. Shpital
This repository contains the official PyTorch implementation of SpectralNet, a digital neural architecture motivated by the Chernoff-Remizov constructive line for operator evolution.
The core idea is to interpret a learnable spectral layer as a discrete approximation of a small-step family whose repeated composition approximates a semigroup, while dense aggregation of intermediate states with decaying weights approximates the resolvent as a Laplace transform of the evolution.
git clone https://github.com/shpital/spectralnet.git
cd spectralnet
pip install -r requirements.txtThe repository uses Hydra for configuration management. All configurations are located in the configs/ directory. The main execution scripts are located in src/spectralnet/cli/.
Train SpectralNet (e.g., EXP-004 on CIFAR-10):
python src/spectralnet/cli/train.py \
--config-name experiment/exp004_vision_cifar10_multiseed \
training.seed=42Train Baselines (ResNet-18, MobileNetV2, ShuffleNetV2):
python src/spectralnet/cli/train_baseline.py \
--config-name experiment/exp_baseline_cifar10 \
model.baseline_type=resnet18 \
training.seed=42Logs, checkpoints, and a lineage.json (containing the exact configuration and metrics) will be saved in results/runs/<timestamp>_....
The repository includes several scripts to evaluate pre-trained models across different dimensions. These scripts automatically scan the results/ directory, find the best checkpoints using lineage.json, and compute metrics.
Robustness Evaluation: Evaluates model robustness against AWGN, Gaussian Blur, and Contrast reduction.
python src/spectralnet/cli/eval_robustness_rmsb.py \
--mode full \
--runs_main ./results/runs \
--runs_rmsb ./results/rmsb \
--output ./results/robustness_summary.jsonEfficiency Metrics:
Computes parameters, MACs (requires ptflops or thop), latency, throughput, and peak GPU memory.
python src/spectralnet/cli/eval_efficiency_rmsb.py \
--runs_main ./results/runs \
--runs_rmsb ./results/rmsb \
--output ./results/efficiency_summary.jsonConditioning Analysis:
Analyzes the spectral operator
python src/spectralnet/cli/eval_conditioning_rmsb.py \
--runs_main ./results/runs \
--runs_rmsb ./results/rmsb \
--output ./results/conditioning_summary.jsonAggregate Multi-seed Results: Computes mean and standard deviation across multiple seeds for a given experiment.
python src/spectralnet/cli/collect_results.py \
--runs_dir ./results/runs \
--exp_name exp004_vision_cifar10_multiseed \
--output ./results/exp004_summary.jsonNumerical Audit (Gradcheck):
Runs an isolated PyTorch gradcheck in float64 to verify the differentiability of the complex FFT math and spectral masking.
python src/spectralnet/cli/run_gradcheck.pyThis project is licensed under the MIT License.
If you find this work useful in your research, please consider citing:
@misc{shpital2026spectralnet,
title={SpectralNet: A Resolvent-Inspired Neural Architecture Based on Chernoff Approximations and Photonic Motivation},
author={Sergey V. Shpital},
year={2026},
doi={10.5281/zenodo.19452600},
url={https://doi.org/10.5281/zenodo.19452600},
publisher={Zenodo}
}