界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

snntorch

snntorch

【数据与研究】Use snnTorch to build spiking neuron models, encode data into spikes, train with surrogate gradients, plot spike tensors, export/import NIR graphs, and maintain legacy spikevision workflows.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: snntorch description: "Use snnTorch to build spiking neuron models, encode data into spikes, train with surrogate gradients, plot spike tensors, export/import NIR graphs, and maintain legacy spikevision workflows." disable-model-invocation: true metadata: disco-role: operating license: MIT

snnTorch

Use this skill when a task touches the snntorch package: stateful spiking neurons, spike encoders, surrogate gradients, training helpers, plotting, NIR exchange, or legacy neuromorphic datasets.

Install and import check

Read Install and import for the package-level install matrix. For a quick smoke test, run:

pip install snntorch
python -c "import snntorch as snn; print(snn.__version__)"
python scripts/stack_smoke.py

If you need the broader stack for plotting, NIR, or legacy dataset workflows, add the optional dependencies described in that reference.

Route by task

  • Build, combine, or debug neuron and layer workflows, hidden-state ownership, reset semantics, recurrent cells, BNTT, or GradedSpikes -> core-neurons
  • Convert raw tensors or labels into spikes, choose surrogate gradients, compute losses or accuracies, inspect monitors, run backprop wrappers, or use STDP -> encoding-training
  • Export supported models to NIR or import NIR graphs back into snnTorch -> nir-interoperability
  • Plot rasters, spike counts, traces, or animations -> plotting
  • Use the legacy spikevision dataset wrappers or migrate old neuromorphic dataset code -> spikevision

Common starting points

  • If the model returns the wrong number of values, states leak across batches, or nn.Sequential breaks on tuple outputs, start with core-neurons.
  • If the task starts with tensors or labels and ends with spike codes, a loss, or a training step, start with encoding-training.
  • If export_to_nir or import_from_nir fails with type inference or graph-shape errors, start with nir-interoperability.
  • If plotting fails in a headless environment or spike_count labels behave oddly, start with plotting.
  • If an old tutorial or repo script uses snntorch.spikevision, treat it as legacy and start with spikevision; new work should use Tonic instead.

Shared references

Boundaries

This skill is a runtime router, not a maintainer guide. It does not cover release engineering, CI, packaging automation, or repo-specific development tasks. Keep the generated guidance self-contained inside this skill tree and use the sub-skills for workflow depth.

我的收藏