rsnn-eta
A biologically-inspired ETA estimator using a Recurrent Spiking Neural Network (RSNN) with Spike-Timing-Dependent Plasticity (STDP).
What it does
Predicts time remaining for long-running tasks. A pluggable base estimator (default: EMA) provides a naive ETA, and an RSNN learns a correction factor from prediction errors. The network adapts online via STDP, detecting phase transitions, bursts, and non-linear progress patterns that defeat simple smoothing.
Architecture
tick(pos, len, elapsed, now)
|
+-> Base Estimator (EMA) --> base_eta
|
+-> Encoder (rate + temporal coding)
| |
| v
| RSNN Reservoir (LIF neurons, sparse E/I, STDP)
| |
| v
| Decoder --> correction_factor
|
+-> final_eta = base_eta * (confidence * factor + (1-confidence) * 1.0)
- LIF neurons with log-uniform time constants and configurable E/I ratio
- Vanilla STDP with error-modulated eligibility traces
- Confidence blending — correction factor is damped toward 1.0 when predictions are noisy
- Burn-in period — weights are frozen until the base estimator warms up
Usage
use ;
use RsnnEta;
let mut eta = new;
let start = now;
for i in 1..=100
Builder
use RsnnEta;
let mut eta = builder
.neurons // reservoir size (default: 50)
.steps_per_tick // LIF simulation steps per tick (default: 20)
.burn_in_ticks // ticks before STDP learning starts (default: 10)
.ema_alpha // base EMA smoothing factor (default: 0.05)
.seed // RNG seed for reproducibility
.persistence // optional weight save/load
.build;
Custom base estimator
use Duration;
use BaseEstimator;
let eta = builder
.base_estimator
.build;
Side-channel signals
Inject additional features beyond standard progress state:
let = builder.build_with_signals;
// From your workload code:
tx.send.unwrap; // e.g., batch_size_ratio, phase_indicator
The dimension is fixed on first send and held via zero-order hold between updates.
Weight persistence
let mut eta = builder
.persistence
.build; // auto-loads if file exists
// ... run workload ...
eta.save.unwrap; // persist learned weights for next run
Configuration
| Parameter | Default | Description |
|---|---|---|
neurons |
50 | Reservoir neuron count |
steps_per_tick |
20 | LIF simulation steps per progress tick |
burn_in_ticks |
10 | Ticks before STDP learning activates |
ema_alpha |
0.05 | EMA smoothing for default base estimator |
seed |
42 | RNG seed for network initialization |
Advanced configuration via NetworkConfig, StdpConfig, and DecoderConfig structs.
License
MIT