Graphs¶
Event-based graph neural network layer for spike-graph message passing.
StochasticGraphLayer— GNN convolution where message passing happens via bitstreams. Takes adjacency matrix + per-node feature vectors, propagates through graph structure with SC arithmetic. Supports variable-topology graphs.
Python
import numpy as np
from sc_neurocore.graphs import StochasticGraphLayer
adj = (np.random.rand(20, 20) > 0.7).astype(float)
np.fill_diagonal(adj, 0)
layer = StochasticGraphLayer(adj_matrix=adj, n_features=16)
features = np.random.rand(20, 16)
output = layer.forward(features)
sc_neurocore.graphs.gnn
¶
StochasticGraphLayer
¶
Event-Based Graph Convolution Layer. Message Passing happens via Bitstreams.
Source code in src/sc_neurocore/graphs/gnn.py
| Python | |
|---|---|
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
forward(node_features)
¶
node_features: (N, Features)
Source code in src/sc_neurocore/graphs/gnn.py
| Python | |
|---|---|
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |