Build · Topology (graph)
connected_watts_strogatz¶
Generates a connected Watts-Strogatz graph.
from resdag.layers import ESNLayer
reservoir = ESNLayer(500, feedback_size=3, recurrent_initializer='connected_watts_strogatz', spectral_radius=0.9, seed=7)
| parameter | default |
|---|---|
k |
6 |
p |
0.1 |
directed |
True |
self_loops |
True |
Override parameters with recurrent_initializer=("connected_watts_strogatz", {...}) or
pre-configure with get_recurrent_initializer("connected_watts_strogatz", ...).
The existing topology= spelling and get_topology() also work.
A layer spectral_radius rescales this matrix after construction. Use get_recurrent_initializer(..., rescale=False) to keep the native scale.
See also¶
- Initialization — every way to specify structure
- Reference — the registry API
