| name | scitex-nn |
| description | PyTorch neural-network building blocks for neuroscience and signal processing. Differentiable filters (`BandPassFilter`, `BandStopFilter`, `HighPassFilter`, `LowPassFilter`, `GaussianFilter`, `DifferentiableBandPassFilter`) operate on 1D channels-first tensors. `Hilbert` provides differentiable Hilbert transform for analytic-signal extraction. Architecture blocks: `BNet` / `BNet_Res` (B-shaped backbone with optional residual connections), `BHead` (decoder head). Augmentation/regularization: `AxiswiseDropout`, `DropoutChannels`, `ChannelGainChanger`, `FreqGainChanger` (gain perturbation in time and frequency domains for SSL training). Drop-in replacement for hand-rolled `torch.nn.Conv1d` butterworth-init wrappers, scattered Hilbert implementations using `torch.fft`, and bespoke channel-dropout layers. Use whenever a model needs trainable filter banks, differentiable spectral features, or SSL-style time/frequency augmentation. |
Interfaces: Python ⭐⭐⭐ (primary) · CLI — · MCP — · Skills ⭐⭐ · Hook — · HTTP —
scitex-nn
PyTorch building blocks specialized for neuroscience / signal-processing
models — differentiable filters, Hilbert, B-shaped backbones, and
spectral augmentation.
Differentiable filters
from scitex_nn import BandPassFilter, BandStopFilter, GaussianFilter
bp = BandPassFilter(low=4.0, high=8.0, fs=1000.0, order=4)
y = bp(x)
DifferentiableBandPassFilter learns low/high end-to-end (use when
the band of interest is itself a hyperparameter).
Hilbert transform
from scitex_nn import Hilbert
analytic = Hilbert()(x)
Backbones
from scitex_nn import BNet, BNet_Res, BNet_config_v1
cfg = BNet_config_v1(in_chans=64, out_chans=2, ...)
model = BNet(cfg)
BNet_Res adds residual connections; the same config dataclass works.
Augmentation
AxiswiseDropout(p, axis) — drops along a chosen axis (channel,
time, frequency)
DropoutChannels(p) — convenience wrapper
ChannelGainChanger(min_gain, max_gain) — random per-channel gain
FreqGainChanger(...) — same in frequency domain via FFT
These compose as plain nn.Modules — drop into a nn.Sequential.
When to use
- ✅ Trainable / differentiable signal processing inside a model
- ✅ SSL-style time / frequency augmentation pipelines
- ✅ Replacing tens of lines of hand-rolled FIR/Butterworth init
- ❌ Classical (non-trainable) filtering — use
scipy.signal or
scitex-dsp
See also
scitex-dsp — non-trainable counterparts (numpy/scipy-backed)
- General skill
01_arch_06_local-state-directories.md if model
checkpoints / cache directories need a canonical location