Spike Augmentation¶
Spike-aware data augmentation: temporal jitter, spike dropout, rate scaling, noise injection, time reversal. Preserves spike structure unlike image augmentation.
from sc_neurocore.augmentation import SpikeAugmenter
aug = SpikeAugmenter(jitter_ms=1.0, dropout_rate=0.1)
augmented = aug.transform(spike_train)
See Tutorial 57: Spike Augmentation.
sc_neurocore.augmentation
¶
Spike-aware augmentation and curriculum scheduling for SNN training.
SpikeAugment
dataclass
¶
Composable spike-domain augmentation.
Parameters¶
jitter_steps : int Max temporal jitter in timesteps (spikes shift +/- jitter). dropout_rate : float Probability of dropping each spike (0.0 = none, 1.0 = all). rate_scale : tuple of float (min_scale, max_scale) for random firing rate scaling. polarity_flip_prob : float Probability of flipping spike polarity (for DVS ON/OFF channels). bg_noise_rate : float Background noise spike probability per neuron per step. hot_pixel_prob : float Probability of a neuron becoming a hot pixel (fires every step). seed : int Random seed for reproducibility.
Source code in src/sc_neurocore/augmentation/spike_augment.py
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 76 77 78 79 80 81 82 83 84 85 86 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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
__call__(spikes)
¶
Apply all augmentations to a spike tensor.
Parameters¶
spikes : ndarray of shape (T, n_neurons) Binary spike matrix.
Returns¶
ndarray of same shape Augmented spike matrix.
Source code in src/sc_neurocore/augmentation/spike_augment.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
SpikeCurriculum
dataclass
¶
Schedule training difficulty across epochs.
Parameters¶
total_epochs : int Total training epochs. start_timesteps : int Initial sequence length. end_timesteps : int Final sequence length. start_rate_scale : float Initial firing rate multiplier (>1 = amplified = easier). end_rate_scale : float Final firing rate multiplier (1.0 = natural). start_noise : float Initial background noise rate. end_noise : float Final background noise rate. warmup_fraction : float Fraction of epochs for linear warmup (0.0-1.0).
Source code in src/sc_neurocore/augmentation/curriculum.py
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 76 77 78 79 80 81 82 83 84 85 86 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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
timesteps(epoch)
¶
Sequence length for this epoch.
Source code in src/sc_neurocore/augmentation/curriculum.py
67 68 69 70 | |
rate_scale(epoch)
¶
Firing rate multiplier for this epoch.
Source code in src/sc_neurocore/augmentation/curriculum.py
72 73 74 75 | |
noise_rate(epoch)
¶
Background noise rate for this epoch.
Source code in src/sc_neurocore/augmentation/curriculum.py
77 78 79 80 | |
apply_to_spikes(spikes, epoch, seed=0)
¶
Apply curriculum-scheduled transforms to a spike tensor.
Parameters¶
spikes : ndarray of shape (T, n_neurons) epoch : int seed : int
Returns¶
ndarray Transformed spikes (possibly truncated/padded to scheduled T).
Source code in src/sc_neurocore/augmentation/curriculum.py
82 83 84 85 86 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 122 123 124 125 126 | |
schedule_summary()
¶
Print the curriculum schedule.
Source code in src/sc_neurocore/augmentation/curriculum.py
128 129 130 131 132 133 134 135 136 137 138 139 140 | |