Phase-Gradient Duality: backpropagation-free learning in coupled oscillator networks.
In a Kuramoto oscillator network at equilibrium, the physical phase response to weak output clamping equals the gradient of the loss with respect to natural frequencies. This enables a learning rule that requires no separate backward pass — two forward passes of the same physics compute both the prediction and the gradient.
from phasegrad import run_verification
results = run_verification(sizes=[6, 10, 15, 20])
# All cosine similarities = 1.000000from phasegrad import KuramotoNetwork, train, spectral_seed
from phasegrad.kuramoto import make_network
from phasegrad.data import load_hillenbrand
train_data, test_data, info = load_hillenbrand(vowels=['a', 'i'])
net = make_network(n_input=2, n_hidden=5, n_output=2)
spectral_seed(net) # topology-aware init for sparse layered architectures
history = train(net, train_data, test_data, epochs=200)from phasegrad.autograd_verify import verify_autograd_table
# Reproduces Table 1 with computationally independent PyTorch verification
results = verify_autograd_table(sizes=[6, 10, 15, 20])Install with pip install -e ".[autograd]" for PyTorch support.
pip install -e .Requires Python 3.10+, NumPy, SciPy. Optional: pip install -e ".[plots]" for matplotlib, pip install -e ".[dev]" for pytest + scikit-learn.
For a network of coupled Kuramoto oscillators with dynamics
at a stable equilibrium
where
The proof uses the implicit function theorem: the equilibrium defines
| Result | Value |
|---|---|
| Gradient identity (cosine similarity) | 1.000000 at all N tested (6–200) |
| Equilibrium residuals | At or below machine epsilon |
| Natural freq vs coupling (converged, matched params) | 96.0% vs 83.3% (p = 1.8 × 10⁻¹²) |
| Spectral seeding success rate | 100/100 (vs 46/100 random init) |
phasegrad/ Library: kuramoto, gradient, training, verification, seeding, autograd_verify
tests/ 10 test files (gradient identity, coupling gradient, training, robustness, scaling, statistical, seeding, autograd)
experiments/ All experiment scripts + reproducible JSON results
paper/ LaTeX source, compiled PDF, figures
examples/ Quick-start scripts
data/ Hillenbrand vowel formant dataset
pip install -e ".[dev]"
pytest tests/python paper/generate_figures.py
# Outputs to paper/figures/Rashahmadi, M. (2026). Equilibrium Propagation with Natural Frequencies
in Coupled Oscillator Networks. Calibur Labs.
MIT