Pipeline¶
Data ingestion and training orchestration for SNN workflows.
DataIngestor— Validated multimodal dataset preparation: min-max normalizes each modality to[0, 1], preserves the reservedlabelsfield as labels, and rejects empty, scalar, non-finite, or mismatched sample axes.SCTrainingLoop— Standard and RL training orchestration with logging, checkpointing, and early stopping
from sc_neurocore.pipeline import DataIngestor, SCTrainingLoop
dataset = DataIngestor().prepare_dataset(
{"vision": [[0.0, 1.0], [2.0, 3.0]], "labels": [0, 1]}
)
sample = dataset.get_sample(0)
sc_neurocore.pipeline
¶
sc_neurocore.pipeline -- Tier: research (experimental / research).
DataIngestor
¶
Normalize raw multimodal arrays into a MultimodalDataset.
Parameters¶
label_key: Reserved key used to extract labels from the raw input mapping.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
__init__(label_key=DEFAULT_LABEL_KEY)
¶
Initialize the ingestor with the reserved label key.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
96 97 98 99 100 | |
prepare_dataset(raw_data)
¶
Normalize and package raw multimodal data.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
MultimodalDataset
dataclass
¶
Validated multimodal training dataset.
Parameters¶
data: Mapping from modality names to normalized arrays. The first axis is the sample axis and must have the same length for every modality. labels: Label array whose first axis matches the modality sample count.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
__post_init__()
¶
Validate dataset shape invariants after construction.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
78 79 80 | |
get_sample(idx)
¶
Return the per-modality arrays for one sample index.
Source code in src/sc_neurocore/pipeline/ingestion.py
| Python | |
|---|---|
82 83 84 | |
SCTrainingLoop
¶
Standard and Reinforcement Learning loops for SC Networks.
Source code in src/sc_neurocore/pipeline/training.py
| Python | |
|---|---|
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
run_rl_epoch(agent, env_step_func, input_data, generations=10)
staticmethod
¶
Runs a reinforcement learning epoch. Uses RewardModulatedSTDPSynapse logic.
Source code in src/sc_neurocore/pipeline/training.py
| Python | |
|---|---|
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
train_multimodal_fusion(fusion_layer, dataset, epochs=5)
staticmethod
¶
Train weights in a multimodal fusion layer via per-sample updates.
Iterates over the dataset for epochs rounds, calling
fusion_layer.train_step(sample) on each sample returned by
dataset.get_sample(i). The fusion layer is responsible for
its own weight update rule (Hebbian, LMS, etc.).
Source code in src/sc_neurocore/pipeline/training.py
| Python | |
|---|---|
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |