This guide explains how to add a new SNN or ANN forecasting model to SpikingTSF.
Create models/<YourModel>.py. The model class should:
- Accept configuration arguments (via the
argsnamespace passed fromrun_long.py) - Implement a
forward(x)method taking(batch, seq_len, n_vars)and returning(batch, pred_len, n_vars) - Follow the interface of existing models (e.g.,
models/SpikF.py,models/TSGRU.py)
Include a comment at the top citing the original paper.
This is where models are actually imported and instantiated. You need to make three additions:
a) Add the import at the top:
from models.YourModel import YourModelb) Add it to the _MODEL_REGISTRY dict (or the equivalent mapping used to build the model):
'YourModel': YourModel,c) Classify it by adding its name to the appropriate set:
_ANN_MODELS— if it is an ANN (no spikes)_CD_MODELS— if it usesspikingjelly.clock_drivenand needscd_functional.reset_net()_AB_MODELS— if it usesspikingjelly.activation_based_SELF_RESET_MODELS— if the model resets itself internally duringforward()
Check which SpikingJelly backend your model uses and pick accordingly.
Add the model name to the choices list for the --model argument:
parser.add_argument('--model', ..., choices=[
...
'YourModel',
])Create configs/<YourModel>/ETTh1.yaml with default hyperparameters. Use existing YAML configs as templates.
Create scripts/<YourModel>/run_ETTh1.sh with the standard 3-seed pattern. Add scripts for other datasets as available.
Add a row with model name, type, Spike?, source paper, source repo, file path, and status.
In MODEL_ZOO.md and in the model file, provide the BibTeX citation for the original paper.
If you have results following the protocol in PROTOCOL.md, add them to RESULTS.md.
Follow the checklist in CONTRIBUTING.md and the PR template.