Build · Topology (graph)
random¶
Generate a random directed graph with a given density.
from resdag.layers import ESNLayer
reservoir = ESNLayer(500, feedback_size=3, recurrent_initializer='random', spectral_radius=0.9, seed=7)
| parameter | default |
|---|---|
density |
0.5 |
Override parameters with recurrent_initializer=("random", {...}) or
pre-configure with get_recurrent_initializer("random", ...).
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
