spikeforge 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spikeforge-0.3.0/LICENSE +30 -0
- spikeforge-0.3.0/PKG-INFO +149 -0
- spikeforge-0.3.0/README.md +94 -0
- spikeforge-0.3.0/main.py +26 -0
- spikeforge-0.3.0/main_encodings.py +43 -0
- spikeforge-0.3.0/pyproject.toml +130 -0
- spikeforge-0.3.0/setup.cfg +4 -0
- spikeforge-0.3.0/spikeforge/__init__.py +19 -0
- spikeforge-0.3.0/spikeforge/benchmark/__init__.py +44 -0
- spikeforge-0.3.0/spikeforge/benchmark/__main__.py +14 -0
- spikeforge-0.3.0/spikeforge/benchmark/cli.py +192 -0
- spikeforge-0.3.0/spikeforge/benchmark/compare.py +192 -0
- spikeforge-0.3.0/spikeforge/benchmark/config.py +40 -0
- spikeforge-0.3.0/spikeforge/benchmark/energy.py +31 -0
- spikeforge-0.3.0/spikeforge/benchmark/harness.py +239 -0
- spikeforge-0.3.0/spikeforge/benchmark/memory.py +63 -0
- spikeforge-0.3.0/spikeforge/benchmark/serving.py +318 -0
- spikeforge-0.3.0/spikeforge/benchmark/store.py +114 -0
- spikeforge-0.3.0/spikeforge/benchmark/suite.py +74 -0
- spikeforge-0.3.0/spikeforge/benchmark/timing.py +53 -0
- spikeforge-0.3.0/spikeforge/cli/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/cli/backend_cli.py +117 -0
- spikeforge-0.3.0/spikeforge/cli/extract_cli.py +147 -0
- spikeforge-0.3.0/spikeforge/cli/fixture.py +94 -0
- spikeforge-0.3.0/spikeforge/cli/onnx_cli.py +85 -0
- spikeforge-0.3.0/spikeforge/cli/records_cli.py +151 -0
- spikeforge-0.3.0/spikeforge/cli/verify.py +156 -0
- spikeforge-0.3.0/spikeforge/compression/__init__.py +52 -0
- spikeforge-0.3.0/spikeforge/compression/codec.py +226 -0
- spikeforge-0.3.0/spikeforge/compression/errors.py +19 -0
- spikeforge-0.3.0/spikeforge/compression/pruning.py +234 -0
- spikeforge-0.3.0/spikeforge/compression/report.py +70 -0
- spikeforge-0.3.0/spikeforge/config.py +78 -0
- spikeforge-0.3.0/spikeforge/data/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/data/data_loader.py +19 -0
- spikeforge-0.3.0/spikeforge/data/dataset_spec.py +35 -0
- spikeforge-0.3.0/spikeforge/data/datasets.py +176 -0
- spikeforge-0.3.0/spikeforge/data/download_cli.py +30 -0
- spikeforge-0.3.0/spikeforge/data/event_errors.py +19 -0
- spikeforge-0.3.0/spikeforge/data/event_geometry.py +17 -0
- spikeforge-0.3.0/spikeforge/data/event_loader.py +138 -0
- spikeforge-0.3.0/spikeforge/data/image_size.py +21 -0
- spikeforge-0.3.0/spikeforge/data/sample_source.py +53 -0
- spikeforge-0.3.0/spikeforge/data/sequence_source.py +59 -0
- spikeforge-0.3.0/spikeforge/encoding/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/encoding/delta_trainer.py +66 -0
- spikeforge-0.3.0/spikeforge/encoding/latency_trainer.py +115 -0
- spikeforge-0.3.0/spikeforge/encoding/random_spikegen.py +54 -0
- spikeforge-0.3.0/spikeforge/encoding/spike_encoder.py +151 -0
- spikeforge-0.3.0/spikeforge/events/__init__.py +8 -0
- spikeforge-0.3.0/spikeforge/events/dense.py +55 -0
- spikeforge-0.3.0/spikeforge/events/event_bridge.py +109 -0
- spikeforge-0.3.0/spikeforge/events/event_sample.py +124 -0
- spikeforge-0.3.0/spikeforge/events/event_source.py +125 -0
- spikeforge-0.3.0/spikeforge/events/synthetic.py +82 -0
- spikeforge-0.3.0/spikeforge/events/tonic_api.py +79 -0
- spikeforge-0.3.0/spikeforge/exporters/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/exporters/delta_exporter.py +46 -0
- spikeforge-0.3.0/spikeforge/exporters/exporter.py +31 -0
- spikeforge-0.3.0/spikeforge/exporters/latency_curve_exporter.py +26 -0
- spikeforge-0.3.0/spikeforge/exporters/latency_raster_exporter.py +39 -0
- spikeforge-0.3.0/spikeforge/exporters/latency_video_exporter.py +26 -0
- spikeforge-0.3.0/spikeforge/exporters/plot_utils.py +60 -0
- spikeforge-0.3.0/spikeforge/exporters/presentation_exporter.py +159 -0
- spikeforge-0.3.0/spikeforge/exporters/random_spike_raster_exporter.py +28 -0
- spikeforge-0.3.0/spikeforge/exporters/random_spike_video_exporter.py +23 -0
- spikeforge-0.3.0/spikeforge/exporters/raster_exporter.py +58 -0
- spikeforge-0.3.0/spikeforge/exporters/reconstruction_exporter.py +49 -0
- spikeforge-0.3.0/spikeforge/exporters/spike_gif_exporter.py +41 -0
- spikeforge-0.3.0/spikeforge/exporters/video_exporter.py +24 -0
- spikeforge-0.3.0/spikeforge/introspection/__init__.py +10 -0
- spikeforge-0.3.0/spikeforge/introspection/comparison.py +78 -0
- spikeforge-0.3.0/spikeforge/introspection/decoding.py +114 -0
- spikeforge-0.3.0/spikeforge/introspection/encoding.py +156 -0
- spikeforge-0.3.0/spikeforge/introspection/firing_rate.py +22 -0
- spikeforge-0.3.0/spikeforge/introspection/histogram.py +36 -0
- spikeforge-0.3.0/spikeforge/introspection/isi.py +64 -0
- spikeforge-0.3.0/spikeforge/introspection/metrics.py +46 -0
- spikeforge-0.3.0/spikeforge/introspection/sparsity.py +22 -0
- spikeforge-0.3.0/spikeforge/introspection/surrogate.py +113 -0
- spikeforge-0.3.0/spikeforge/memory/__init__.py +8 -0
- spikeforge-0.3.0/spikeforge/memory/frozen_classifier.py +78 -0
- spikeforge-0.3.0/spikeforge/memory/hebbian_synapse.py +57 -0
- spikeforge-0.3.0/spikeforge/memory/held_out_digit_poc.py +169 -0
- spikeforge-0.3.0/spikeforge/memory/lockstep_runner.py +49 -0
- spikeforge-0.3.0/spikeforge/memory/one_shot_associative_memory.py +83 -0
- spikeforge-0.3.0/spikeforge/network/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/network/hidden_frames.py +37 -0
- spikeforge-0.3.0/spikeforge/network/inference.py +153 -0
- spikeforge-0.3.0/spikeforge/network/model_diff.py +119 -0
- spikeforge-0.3.0/spikeforge/network/model_search.py +106 -0
- spikeforge-0.3.0/spikeforge/network/model_store.py +119 -0
- spikeforge-0.3.0/spikeforge/network/spiking_net.py +102 -0
- spikeforge-0.3.0/spikeforge/neurons/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/neurons/alpha.py +74 -0
- spikeforge-0.3.0/spikeforge/neurons/contract.py +135 -0
- spikeforge-0.3.0/spikeforge/neurons/handler.py +35 -0
- spikeforge-0.3.0/spikeforge/neurons/lapicque.py +48 -0
- spikeforge-0.3.0/spikeforge/neurons/leaky.py +48 -0
- spikeforge-0.3.0/spikeforge/neurons/recurrent.py +70 -0
- spikeforge-0.3.0/spikeforge/neurons/registry.py +38 -0
- spikeforge-0.3.0/spikeforge/neurons/spike_grad.py +25 -0
- spikeforge-0.3.0/spikeforge/neurons/synaptic.py +53 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/__init__.py +72 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/api.py +143 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/array_codec.py +60 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/drift.py +76 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/errors.py +110 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/exporter.py +99 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/extract.py +73 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/ingest.py +37 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/interpreter.py +237 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/interpreter_result.py +23 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/jsonable.py +38 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/mapped_node.py +15 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/mapper.py +67 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/neuron_kwargs.py +58 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/neuron_nodes.py +174 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/node_builders.py +206 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/node_names.py +58 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/ops_common.py +22 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/ops_linear.py +94 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/ops_neuron.py +140 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/ops_registry.py +103 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/planner.py +184 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/require.py +18 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/roundtrip.py +100 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/serialization.py +134 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/stage_builders.py +33 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/stage_mapping.py +21 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/stages_unmappable.py +31 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/tolerances.py +30 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/torch_map.py +42 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/validation_report.py +49 -0
- spikeforge-0.3.0/spikeforge/nir_bridge/validator.py +206 -0
- spikeforge-0.3.0/spikeforge/observability/__init__.py +26 -0
- spikeforge-0.3.0/spikeforge/observability/json_formatter.py +36 -0
- spikeforge-0.3.0/spikeforge/observability/logging_setup.py +109 -0
- spikeforge-0.3.0/spikeforge/observability/metrics.py +49 -0
- spikeforge-0.3.0/spikeforge/observability/persistence.py +119 -0
- spikeforge-0.3.0/spikeforge/observability/prometheus.py +173 -0
- spikeforge-0.3.0/spikeforge/observability/registry.py +88 -0
- spikeforge-0.3.0/spikeforge/observability/snapshot.py +48 -0
- spikeforge-0.3.0/spikeforge/observability/store.py +75 -0
- spikeforge-0.3.0/spikeforge/observability/timer.py +30 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/__init__.py +52 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/api.py +187 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/errors.py +68 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/export.py +106 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/import_onnx.py +209 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/metadata.py +47 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/roundtrip.py +48 -0
- spikeforge-0.3.0/spikeforge/onnx_bridge/step_module.py +28 -0
- spikeforge-0.3.0/spikeforge/py.typed +0 -0
- spikeforge-0.3.0/spikeforge/runtime/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/runtime/device.py +144 -0
- spikeforge-0.3.0/spikeforge/runtime/execution_mode.py +16 -0
- spikeforge-0.3.0/spikeforge/runtime/system_stats.py +75 -0
- spikeforge-0.3.0/spikeforge/serving/__init__.py +42 -0
- spikeforge-0.3.0/spikeforge/serving/bundle.py +504 -0
- spikeforge-0.3.0/spikeforge/serving/bundle_manifest.py +143 -0
- spikeforge-0.3.0/spikeforge/serving/encode_spec.py +320 -0
- spikeforge-0.3.0/spikeforge/serving/errors.py +93 -0
- spikeforge-0.3.0/spikeforge/serving/prediction.py +35 -0
- spikeforge-0.3.0/spikeforge/serving/preprocess.py +109 -0
- spikeforge-0.3.0/spikeforge/serving/session.py +262 -0
- spikeforge-0.3.0/spikeforge/serving/state_tree.py +45 -0
- spikeforge-0.3.0/spikeforge/serving/step.py +10 -0
- spikeforge-0.3.0/spikeforge/serving/tensor_codec.py +76 -0
- spikeforge-0.3.0/spikeforge/simulator/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/simulator/compiled_step.py +126 -0
- spikeforge-0.3.0/spikeforge/simulator/execution.py +151 -0
- spikeforge-0.3.0/spikeforge/simulator/frames.py +38 -0
- spikeforge-0.3.0/spikeforge/simulator/grad_policy.py +76 -0
- spikeforge-0.3.0/spikeforge/simulator/input_shape.py +63 -0
- spikeforge-0.3.0/spikeforge/simulator/module_spec.py +16 -0
- spikeforge-0.3.0/spikeforge/simulator/parallel_runner.py +45 -0
- spikeforge-0.3.0/spikeforge/simulator/production.py +31 -0
- spikeforge-0.3.0/spikeforge/simulator/production_result.py +27 -0
- spikeforge-0.3.0/spikeforge/simulator/runner.py +47 -0
- spikeforge-0.3.0/spikeforge/simulator/state.py +37 -0
- spikeforge-0.3.0/spikeforge/simulator/step_stages.py +61 -0
- spikeforge-0.3.0/spikeforge/simulator/trajectory.py +30 -0
- spikeforge-0.3.0/spikeforge/streaming/__init__.py +98 -0
- spikeforge-0.3.0/spikeforge/streaming/encoding.py +102 -0
- spikeforge-0.3.0/spikeforge/streaming/recipe.py +341 -0
- spikeforge-0.3.0/spikeforge/streaming/serving.py +230 -0
- spikeforge-0.3.0/spikeforge/streaming/stream_source.py +242 -0
- spikeforge-0.3.0/spikeforge/streaming/window_spec.py +183 -0
- spikeforge-0.3.0/spikeforge/topology/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/topology/attention.py +33 -0
- spikeforge-0.3.0/spikeforge/topology/builder.py +9 -0
- spikeforge-0.3.0/spikeforge/topology/edge.py +35 -0
- spikeforge-0.3.0/spikeforge/topology/kinds.py +32 -0
- spikeforge-0.3.0/spikeforge/topology/multihead_attention.py +54 -0
- spikeforge-0.3.0/spikeforge/topology/ordering.py +45 -0
- spikeforge-0.3.0/spikeforge/topology/positional_encoding.py +38 -0
- spikeforge-0.3.0/spikeforge/topology/presets.py +250 -0
- spikeforge-0.3.0/spikeforge/topology/registry.py +192 -0
- spikeforge-0.3.0/spikeforge/topology/sequence_presets.py +143 -0
- spikeforge-0.3.0/spikeforge/topology/sequence_stages.py +75 -0
- spikeforge-0.3.0/spikeforge/topology/spec.py +158 -0
- spikeforge-0.3.0/spikeforge/topology/stage.py +35 -0
- spikeforge-0.3.0/spikeforge/topology/stage_module.py +152 -0
- spikeforge-0.3.0/spikeforge/topology/stage_modules.py +117 -0
- spikeforge-0.3.0/spikeforge/topology/sum_pool.py +45 -0
- spikeforge-0.3.0/spikeforge/topology/validation.py +62 -0
- spikeforge-0.3.0/spikeforge/tracking/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/tracking/config_hash.py +27 -0
- spikeforge-0.3.0/spikeforge/tracking/determinism.py +128 -0
- spikeforge-0.3.0/spikeforge/tracking/manifest.py +104 -0
- spikeforge-0.3.0/spikeforge/tracking/seed.py +42 -0
- spikeforge-0.3.0/spikeforge/tracking/sink.py +31 -0
- spikeforge-0.3.0/spikeforge/tracking/sink_probe.py +36 -0
- spikeforge-0.3.0/spikeforge/tracking/sink_records.py +33 -0
- spikeforge-0.3.0/spikeforge/tracking/sinks.py +87 -0
- spikeforge-0.3.0/spikeforge/tracking/tensorboard_sink.py +45 -0
- spikeforge-0.3.0/spikeforge/tracking/versions.py +44 -0
- spikeforge-0.3.0/spikeforge/tracking/wandb_sink.py +46 -0
- spikeforge-0.3.0/spikeforge/training/__init__.py +1 -0
- spikeforge-0.3.0/spikeforge/training/amp_controller.py +101 -0
- spikeforge-0.3.0/spikeforge/training/checkpoint_mixin.py +146 -0
- spikeforge-0.3.0/spikeforge/training/encoding_mixin.py +73 -0
- spikeforge-0.3.0/spikeforge/training/eval_mixin.py +51 -0
- spikeforge-0.3.0/spikeforge/training/event_batches.py +70 -0
- spikeforge-0.3.0/spikeforge/training/event_engine.py +207 -0
- spikeforge-0.3.0/spikeforge/training/logger.py +34 -0
- spikeforge-0.3.0/spikeforge/training/multi_device.py +61 -0
- spikeforge-0.3.0/spikeforge/training/scaleup_mixin.py +150 -0
- spikeforge-0.3.0/spikeforge/training/topology_mixin.py +90 -0
- spikeforge-0.3.0/spikeforge/training/trainer.py +166 -0
- spikeforge-0.3.0/spikeforge/training/training_engine.py +256 -0
- spikeforge-0.3.0/spikeforge.egg-info/PKG-INFO +149 -0
- spikeforge-0.3.0/spikeforge.egg-info/SOURCES.txt +237 -0
- spikeforge-0.3.0/spikeforge.egg-info/dependency_links.txt +1 -0
- spikeforge-0.3.0/spikeforge.egg-info/entry_points.txt +6 -0
- spikeforge-0.3.0/spikeforge.egg-info/not-zip-safe +1 -0
- spikeforge-0.3.0/spikeforge.egg-info/requires.txt +40 -0
- spikeforge-0.3.0/spikeforge.egg-info/top_level.txt +3 -0
spikeforge-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Capsize LLC
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spikeforge
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Spiking neural network trainer/experiments for MNIST built with snnTorch and PyTorch.
|
|
5
|
+
Author-email: Capsize LLC <contact@capsizegames.com>
|
|
6
|
+
Maintainer-email: Capsize LLC <contact@capsizegames.com>
|
|
7
|
+
License-Expression: BSD-3-Clause
|
|
8
|
+
Project-URL: Homepage, https://github.com/capsize-games/spikeforge
|
|
9
|
+
Project-URL: Repository, https://github.com/capsize-games/spikeforge
|
|
10
|
+
Keywords: spiking neural networks,snn,snntorch,pytorch,mnist
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: torch>=2.5
|
|
25
|
+
Requires-Dist: torchvision>=0.20
|
|
26
|
+
Requires-Dist: snntorch>=1.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.8
|
|
28
|
+
Requires-Dist: Pillow>=10.0
|
|
29
|
+
Requires-Dist: numpy>=1.26
|
|
30
|
+
Requires-Dist: psutil>=5.9
|
|
31
|
+
Provides-Extra: all
|
|
32
|
+
Requires-Dist: spikeforge-targets~=0.1.0; extra == "all"
|
|
33
|
+
Requires-Dist: spikeforge-hub~=0.1.0; extra == "all"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
37
|
+
Requires-Dist: ruff>=0.0.280; extra == "dev"
|
|
38
|
+
Requires-Dist: jsonschema>=4; extra == "dev"
|
|
39
|
+
Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
|
|
40
|
+
Provides-Extra: nir
|
|
41
|
+
Requires-Dist: nir>=1.0; extra == "nir"
|
|
42
|
+
Requires-Dist: nirtorch>=1.0; extra == "nir"
|
|
43
|
+
Provides-Extra: events
|
|
44
|
+
Requires-Dist: tonic>=1.4; extra == "events"
|
|
45
|
+
Provides-Extra: onnx
|
|
46
|
+
Requires-Dist: onnx>=1.14; extra == "onnx"
|
|
47
|
+
Requires-Dist: onnxruntime>=1.16; extra == "onnx"
|
|
48
|
+
Provides-Extra: tracking
|
|
49
|
+
Requires-Dist: tensorboard>=2.0; extra == "tracking"
|
|
50
|
+
Provides-Extra: tracking-wandb
|
|
51
|
+
Requires-Dist: wandb; extra == "tracking-wandb"
|
|
52
|
+
Provides-Extra: docs
|
|
53
|
+
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
# spikeforge
|
|
57
|
+
|
|
58
|
+
[](https://github.com/capsize-games/spikeforge/actions/workflows/ci.yml)
|
|
59
|
+
[](OPEN_SOURCE_CHECKLIST.md)
|
|
60
|
+
[](LICENSE)
|
|
61
|
+
[](https://www.python.org/downloads/)
|
|
62
|
+
[](https://github.com/astral-sh/ruff)
|
|
63
|
+
[](https://github.com/capsize-games/spikeforge/blob/main/CONTRIBUTING.md)
|
|
64
|
+
[](documentation/README.md)
|
|
65
|
+
|
|
66
|
+
A spiking-neural-network (SNN) toolkit built on
|
|
67
|
+
[snnTorch](https://snntorch.readthedocs.io/) and PyTorch. Loads MNIST-style
|
|
68
|
+
and neuromorphic event datasets, encodes them into rate, latency, delta, and
|
|
69
|
+
random spikes, and trains, validates, exports, and deploys LIF networks —
|
|
70
|
+
with a live browser dashboard served over WebSockets.
|
|
71
|
+
|
|
72
|
+
> **Pre-1.0 and unpublished.** `install.sh` is the supported path today;
|
|
73
|
+
> PyPI ships once the distributions are published. Before trusting any
|
|
74
|
+
> number this produces, read
|
|
75
|
+
> [Implications and boundaries](documentation/implications-and-boundaries.md).
|
|
76
|
+
|
|
77
|
+
## Quickstart
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git clone https://github.com/capsize-games/spikeforge.git
|
|
81
|
+
cd spikeforge
|
|
82
|
+
docker compose up --build
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Open <http://localhost:8877> — the dashboard connects to the WebSocket on
|
|
86
|
+
the same host and port. No separate backend or proxy to run.
|
|
87
|
+
|
|
88
|
+
Prefer a local install, a headless example, or the CLI tools instead? See
|
|
89
|
+
[Usage](documentation/usage.md) and [Quickstart](documentation/quickstart.md)
|
|
90
|
+
for every path (`./install.sh`, local dev with Vite, `examples/`, and the
|
|
91
|
+
eight `spikeforge-*` console scripts).
|
|
92
|
+
|
|
93
|
+
## Features
|
|
94
|
+
|
|
95
|
+
- **Encoding** — rate, latency, delta, and random spike coders.
|
|
96
|
+
- **Training** — fully-connected and convolutional LIF networks with
|
|
97
|
+
surrogate-gradient cross-entropy, checkpointing, and opt-in AMP / gradient
|
|
98
|
+
checkpointing / truncated BPTT / multi-GPU.
|
|
99
|
+
- **Topologies** — `fc_legacy`, `fc_small`, `conv_net`, `recurrent_net`, plus
|
|
100
|
+
the sequence presets `sequence_mlp` and `sequence_attn`.
|
|
101
|
+
- **Datasets** — MNIST, Fashion-MNIST, KMNIST, QMNIST, USPS, EMNIST,
|
|
102
|
+
CIFAR-10, and (via the `events` extra) N-MNIST, DVS128 Gesture,
|
|
103
|
+
CIFAR10-DVS, and Spiking Speech Commands.
|
|
104
|
+
- **Interpreter spine** — NIR export, an independent NIR interpreter, and
|
|
105
|
+
numerical drift validation.
|
|
106
|
+
- **Introspection** — educational-mode `U[t]`/`I[t]`/`S[t]` traces,
|
|
107
|
+
trajectory metrics, and surrogate-derivative curves.
|
|
108
|
+
- **Deployment** — a capability matrix, weight quantization, energy
|
|
109
|
+
accounting, and executable `reference`, `norse`, and `lava_loihi2`
|
|
110
|
+
backends.
|
|
111
|
+
- **Model hub** — a curated, offline-first catalog plus optional live
|
|
112
|
+
Hugging Face search.
|
|
113
|
+
- **Dashboard** — a React + TypeScript UI with training, introspection,
|
|
114
|
+
analysis, targets, energy, and hub panels, and seven guided walkthroughs.
|
|
115
|
+
|
|
116
|
+
## Packages
|
|
117
|
+
|
|
118
|
+
This repository is a single workspace that publishes four distributions:
|
|
119
|
+
|
|
120
|
+
| Distribution | Import root | Purpose |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `spikeforge` | `spikeforge` | Core package: encoders, topologies, training, simulator, NIR bridge, tracking |
|
|
123
|
+
| `spikeforge-targets` | `spikeforge_targets` | Deployment targets, quantization, energy accounting, sparse event runtime |
|
|
124
|
+
| `spikeforge-hub` | `spikeforge_hub` | Curated model hub and optional Hugging Face access |
|
|
125
|
+
| `spikeforge-server` | `server` | FastAPI + WebSocket server and dashboard hosting |
|
|
126
|
+
|
|
127
|
+
## Documentation
|
|
128
|
+
|
|
129
|
+
This README stays short on purpose.
|
|
130
|
+
[`documentation/`](documentation/README.md) is the full reference — install
|
|
131
|
+
paths, the CLI tools, architecture, module layout, and the dev workflow —
|
|
132
|
+
written for contributors and coding agents alike. Also see
|
|
133
|
+
[COOKBOOK.md](COOKBOOK.md) for copy-pasteable recipes,
|
|
134
|
+
[examples/](examples/) for runnable end-to-end scripts, and
|
|
135
|
+
[plans/](plans/) for design documents and the roadmap.
|
|
136
|
+
|
|
137
|
+
See [CONTRIBUTING.md](https://github.com/capsize-games/spikeforge/blob/main/CONTRIBUTING.md)
|
|
138
|
+
and [rules.md](rules.md) before opening a pull request.
|
|
139
|
+
|
|
140
|
+
## Citing
|
|
141
|
+
|
|
142
|
+
If spikeforge is useful in your research, please cite it — see
|
|
143
|
+
[CITATION.cff](CITATION.cff) (GitHub renders a "Cite this repository"
|
|
144
|
+
button from it automatically).
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
Released under the **BSD 3-Clause License** — see [LICENSE](LICENSE) and
|
|
149
|
+
[AUTHORS](AUTHORS).
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# spikeforge
|
|
2
|
+
|
|
3
|
+
[](https://github.com/capsize-games/spikeforge/actions/workflows/ci.yml)
|
|
4
|
+
[](OPEN_SOURCE_CHECKLIST.md)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
[](https://github.com/astral-sh/ruff)
|
|
8
|
+
[](https://github.com/capsize-games/spikeforge/blob/main/CONTRIBUTING.md)
|
|
9
|
+
[](documentation/README.md)
|
|
10
|
+
|
|
11
|
+
A spiking-neural-network (SNN) toolkit built on
|
|
12
|
+
[snnTorch](https://snntorch.readthedocs.io/) and PyTorch. Loads MNIST-style
|
|
13
|
+
and neuromorphic event datasets, encodes them into rate, latency, delta, and
|
|
14
|
+
random spikes, and trains, validates, exports, and deploys LIF networks —
|
|
15
|
+
with a live browser dashboard served over WebSockets.
|
|
16
|
+
|
|
17
|
+
> **Pre-1.0 and unpublished.** `install.sh` is the supported path today;
|
|
18
|
+
> PyPI ships once the distributions are published. Before trusting any
|
|
19
|
+
> number this produces, read
|
|
20
|
+
> [Implications and boundaries](documentation/implications-and-boundaries.md).
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/capsize-games/spikeforge.git
|
|
26
|
+
cd spikeforge
|
|
27
|
+
docker compose up --build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Open <http://localhost:8877> — the dashboard connects to the WebSocket on
|
|
31
|
+
the same host and port. No separate backend or proxy to run.
|
|
32
|
+
|
|
33
|
+
Prefer a local install, a headless example, or the CLI tools instead? See
|
|
34
|
+
[Usage](documentation/usage.md) and [Quickstart](documentation/quickstart.md)
|
|
35
|
+
for every path (`./install.sh`, local dev with Vite, `examples/`, and the
|
|
36
|
+
eight `spikeforge-*` console scripts).
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- **Encoding** — rate, latency, delta, and random spike coders.
|
|
41
|
+
- **Training** — fully-connected and convolutional LIF networks with
|
|
42
|
+
surrogate-gradient cross-entropy, checkpointing, and opt-in AMP / gradient
|
|
43
|
+
checkpointing / truncated BPTT / multi-GPU.
|
|
44
|
+
- **Topologies** — `fc_legacy`, `fc_small`, `conv_net`, `recurrent_net`, plus
|
|
45
|
+
the sequence presets `sequence_mlp` and `sequence_attn`.
|
|
46
|
+
- **Datasets** — MNIST, Fashion-MNIST, KMNIST, QMNIST, USPS, EMNIST,
|
|
47
|
+
CIFAR-10, and (via the `events` extra) N-MNIST, DVS128 Gesture,
|
|
48
|
+
CIFAR10-DVS, and Spiking Speech Commands.
|
|
49
|
+
- **Interpreter spine** — NIR export, an independent NIR interpreter, and
|
|
50
|
+
numerical drift validation.
|
|
51
|
+
- **Introspection** — educational-mode `U[t]`/`I[t]`/`S[t]` traces,
|
|
52
|
+
trajectory metrics, and surrogate-derivative curves.
|
|
53
|
+
- **Deployment** — a capability matrix, weight quantization, energy
|
|
54
|
+
accounting, and executable `reference`, `norse`, and `lava_loihi2`
|
|
55
|
+
backends.
|
|
56
|
+
- **Model hub** — a curated, offline-first catalog plus optional live
|
|
57
|
+
Hugging Face search.
|
|
58
|
+
- **Dashboard** — a React + TypeScript UI with training, introspection,
|
|
59
|
+
analysis, targets, energy, and hub panels, and seven guided walkthroughs.
|
|
60
|
+
|
|
61
|
+
## Packages
|
|
62
|
+
|
|
63
|
+
This repository is a single workspace that publishes four distributions:
|
|
64
|
+
|
|
65
|
+
| Distribution | Import root | Purpose |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `spikeforge` | `spikeforge` | Core package: encoders, topologies, training, simulator, NIR bridge, tracking |
|
|
68
|
+
| `spikeforge-targets` | `spikeforge_targets` | Deployment targets, quantization, energy accounting, sparse event runtime |
|
|
69
|
+
| `spikeforge-hub` | `spikeforge_hub` | Curated model hub and optional Hugging Face access |
|
|
70
|
+
| `spikeforge-server` | `server` | FastAPI + WebSocket server and dashboard hosting |
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
This README stays short on purpose.
|
|
75
|
+
[`documentation/`](documentation/README.md) is the full reference — install
|
|
76
|
+
paths, the CLI tools, architecture, module layout, and the dev workflow —
|
|
77
|
+
written for contributors and coding agents alike. Also see
|
|
78
|
+
[COOKBOOK.md](COOKBOOK.md) for copy-pasteable recipes,
|
|
79
|
+
[examples/](examples/) for runnable end-to-end scripts, and
|
|
80
|
+
[plans/](plans/) for design documents and the roadmap.
|
|
81
|
+
|
|
82
|
+
See [CONTRIBUTING.md](https://github.com/capsize-games/spikeforge/blob/main/CONTRIBUTING.md)
|
|
83
|
+
and [rules.md](rules.md) before opening a pull request.
|
|
84
|
+
|
|
85
|
+
## Citing
|
|
86
|
+
|
|
87
|
+
If spikeforge is useful in your research, please cite it — see
|
|
88
|
+
[CITATION.cff](CITATION.cff) (GitHub renders a "Cite this repository"
|
|
89
|
+
button from it automatically).
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
Released under the **BSD 3-Clause License** — see [LICENSE](LICENSE) and
|
|
94
|
+
[AUTHORS](AUTHORS).
|
spikeforge-0.3.0/main.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Entry point: train a rate-coded MNIST subset and export all visuals."""
|
|
2
|
+
|
|
3
|
+
from spikeforge.exporters.presentation_exporter import (
|
|
4
|
+
PresentationGifExporter,
|
|
5
|
+
)
|
|
6
|
+
from spikeforge.exporters.raster_exporter import RasterExporter
|
|
7
|
+
from spikeforge.exporters.reconstruction_exporter import (
|
|
8
|
+
ReconstructionExporter,
|
|
9
|
+
)
|
|
10
|
+
from spikeforge.exporters.spike_gif_exporter import SpikeGifExporter
|
|
11
|
+
from spikeforge.exporters.video_exporter import VideoExporter
|
|
12
|
+
from spikeforge.training.logger import SNNTrainerLogger
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main() -> None:
|
|
16
|
+
"""Build the trainer and write every output artifact."""
|
|
17
|
+
trainer = SNNTrainerLogger(animation_interval=100)
|
|
18
|
+
VideoExporter(trainer).export()
|
|
19
|
+
SpikeGifExporter(trainer).export()
|
|
20
|
+
ReconstructionExporter(trainer).export()
|
|
21
|
+
RasterExporter(trainer).export()
|
|
22
|
+
PresentationGifExporter(trainer).export()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if __name__ == "__main__":
|
|
26
|
+
main()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Run the additional tutorial-1 encoding demos (latency/delta/random).
|
|
2
|
+
|
|
3
|
+
Produces latency curve + rasters + animation, delta plots, and random
|
|
4
|
+
spike visuals under build/.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from spikeforge.encoding.delta_trainer import DeltaTrainer
|
|
8
|
+
from spikeforge.encoding.latency_trainer import LatencyTrainer
|
|
9
|
+
from spikeforge.encoding.random_spikegen import RandomSpikeGenerator
|
|
10
|
+
from spikeforge.exporters.delta_exporter import DeltaPlotExporter
|
|
11
|
+
from spikeforge.exporters.latency_curve_exporter import (
|
|
12
|
+
LatencyCurveExporter,
|
|
13
|
+
)
|
|
14
|
+
from spikeforge.exporters.latency_raster_exporter import (
|
|
15
|
+
LatencyRasterExporter,
|
|
16
|
+
)
|
|
17
|
+
from spikeforge.exporters.latency_video_exporter import (
|
|
18
|
+
LatencyVideoExporter,
|
|
19
|
+
)
|
|
20
|
+
from spikeforge.exporters.random_spike_raster_exporter import (
|
|
21
|
+
RandomSpikeRasterExporter,
|
|
22
|
+
)
|
|
23
|
+
from spikeforge.exporters.random_spike_video_exporter import (
|
|
24
|
+
RandomSpikeVideoExporter,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def main() -> None:
|
|
29
|
+
"""Train the latency/delta/random encoders and export their visuals."""
|
|
30
|
+
latency_trainer = LatencyTrainer(animation_interval=100)
|
|
31
|
+
LatencyCurveExporter(latency_trainer).export()
|
|
32
|
+
LatencyRasterExporter(latency_trainer).export()
|
|
33
|
+
LatencyVideoExporter(latency_trainer).export(key="clip")
|
|
34
|
+
|
|
35
|
+
DeltaPlotExporter(DeltaTrainer()).export()
|
|
36
|
+
|
|
37
|
+
random_spikegen = RandomSpikeGenerator(num_steps=100)
|
|
38
|
+
RandomSpikeRasterExporter(random_spikegen).export()
|
|
39
|
+
RandomSpikeVideoExporter(random_spikegen).export()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
main()
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# PEP 621 packaging authority for the core distribution (ARCH-0001 Phase 1b).
|
|
2
|
+
#
|
|
3
|
+
# The core distribution owns the ``spikeforge`` import root plus the two
|
|
4
|
+
# top-level ``main`` modules. It deliberately excludes ``server/`` so a
|
|
5
|
+
# headless ``pip install spikeforge`` cannot ship the FastAPI server.
|
|
6
|
+
#
|
|
7
|
+
# Phase 1 moves no source: the import root stays at ``spikeforge/`` and is
|
|
8
|
+
# exposed to the build via the ``spikeforge`` symlink next to this file
|
|
9
|
+
# (see the ``packages.find`` table below for why). The server distribution is
|
|
10
|
+
# defined in ``packages/spikeforge-server/pyproject.toml``.
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["setuptools>=68"]
|
|
14
|
+
build-backend = "setuptools.build_meta"
|
|
15
|
+
|
|
16
|
+
[project]
|
|
17
|
+
name = "spikeforge"
|
|
18
|
+
version = "0.3.0"
|
|
19
|
+
description = "Spiking neural network trainer/experiments for MNIST built with snnTorch and PyTorch."
|
|
20
|
+
# ``README.md`` and ``LICENSE`` are committed symlinks to the repository-root
|
|
21
|
+
# files: the distribution metadata points at the root documents while
|
|
22
|
+
# setuptools' sandbox only reads files inside the project directory.
|
|
23
|
+
readme = "README.md"
|
|
24
|
+
requires-python = ">=3.10"
|
|
25
|
+
license = "BSD-3-Clause"
|
|
26
|
+
license-files = ["LICENSE"]
|
|
27
|
+
authors = [
|
|
28
|
+
{ name = "Capsize LLC", email = "contact@capsizegames.com" },
|
|
29
|
+
]
|
|
30
|
+
maintainers = [
|
|
31
|
+
{ name = "Capsize LLC", email = "contact@capsizegames.com" },
|
|
32
|
+
]
|
|
33
|
+
keywords = [
|
|
34
|
+
"spiking neural networks",
|
|
35
|
+
"snn",
|
|
36
|
+
"snntorch",
|
|
37
|
+
"pytorch",
|
|
38
|
+
"mnist",
|
|
39
|
+
]
|
|
40
|
+
classifiers = [
|
|
41
|
+
"Development Status :: 4 - Beta",
|
|
42
|
+
"Intended Audience :: Developers",
|
|
43
|
+
"Intended Audience :: Science/Research",
|
|
44
|
+
"Operating System :: OS Independent",
|
|
45
|
+
"Programming Language :: Python :: 3",
|
|
46
|
+
"Programming Language :: Python :: 3.10",
|
|
47
|
+
"Programming Language :: Python :: 3.11",
|
|
48
|
+
"Programming Language :: Python :: 3.12",
|
|
49
|
+
"Programming Language :: Python :: 3.13",
|
|
50
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
51
|
+
]
|
|
52
|
+
dependencies = [
|
|
53
|
+
"torch>=2.5",
|
|
54
|
+
"torchvision>=0.20",
|
|
55
|
+
"snntorch>=1.0",
|
|
56
|
+
"matplotlib>=3.8",
|
|
57
|
+
"Pillow>=10.0",
|
|
58
|
+
"numpy>=1.26",
|
|
59
|
+
"psutil>=5.9",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[project.optional-dependencies]
|
|
63
|
+
all = [
|
|
64
|
+
"spikeforge-targets~=0.1.0",
|
|
65
|
+
"spikeforge-hub~=0.1.0",
|
|
66
|
+
]
|
|
67
|
+
dev = [
|
|
68
|
+
"pytest>=7.0",
|
|
69
|
+
"pytest-cov>=4.0",
|
|
70
|
+
"ruff>=0.0.280",
|
|
71
|
+
"jsonschema>=4",
|
|
72
|
+
# stdlib ``tomllib`` only lands in 3.11; the packaging-profile tests read
|
|
73
|
+
# the PEP 621 files, so 3.10 development and CI pull in the backport.
|
|
74
|
+
'tomli; python_version < "3.11"',
|
|
75
|
+
]
|
|
76
|
+
nir = [
|
|
77
|
+
"nir>=1.0",
|
|
78
|
+
"nirtorch>=1.0",
|
|
79
|
+
]
|
|
80
|
+
events = [
|
|
81
|
+
"tonic>=1.4",
|
|
82
|
+
]
|
|
83
|
+
onnx = [
|
|
84
|
+
"onnx>=1.14",
|
|
85
|
+
"onnxruntime>=1.16",
|
|
86
|
+
]
|
|
87
|
+
tracking = [
|
|
88
|
+
"tensorboard>=2.0",
|
|
89
|
+
]
|
|
90
|
+
tracking-wandb = [
|
|
91
|
+
"wandb",
|
|
92
|
+
]
|
|
93
|
+
docs = [
|
|
94
|
+
"mkdocs-material>=9.0",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[project.scripts]
|
|
98
|
+
spikeforge = "main:main"
|
|
99
|
+
spikeforge-encodings = "main_encodings:main"
|
|
100
|
+
spikeforge-verify = "spikeforge.cli.verify:main"
|
|
101
|
+
spikeforge-records = "spikeforge.cli.records_cli:main"
|
|
102
|
+
spikeforge-benchmark = "spikeforge.benchmark.cli:main"
|
|
103
|
+
|
|
104
|
+
[project.urls]
|
|
105
|
+
Homepage = "https://github.com/capsize-games/spikeforge"
|
|
106
|
+
Repository = "https://github.com/capsize-games/spikeforge"
|
|
107
|
+
|
|
108
|
+
[tool.setuptools]
|
|
109
|
+
py-modules = ["main", "main_encodings"]
|
|
110
|
+
zip-safe = false
|
|
111
|
+
|
|
112
|
+
[tool.setuptools.packages.find]
|
|
113
|
+
# The design document specifies `where = ["../.."]`. Setuptools >= 68
|
|
114
|
+
# sandboxes a build to the project directory (which is also why README.md and
|
|
115
|
+
# LICENSE are committed symlinks here), and its default `python -m build`
|
|
116
|
+
# builds the wheel from the *extracted sdist*, which cannot carry sources that
|
|
117
|
+
# live outside the project root. The import root is therefore exposed next to
|
|
118
|
+
# this file as a symlink to `../../spikeforge`, keeping the one source of
|
|
119
|
+
# truth at its current repository path while making both `pip install` and
|
|
120
|
+
# `python -m build` produce a complete wheel. The include pairs the exact
|
|
121
|
+
# top-level `spikeforge` package with its `spikeforge.*` subpackages: a bare
|
|
122
|
+
# `spikeforge*` glob would also match the satellites (`spikeforge_targets`,
|
|
123
|
+
# `spikeforge_hub`), so it is deliberately not used, and `server/` can never
|
|
124
|
+
# leak into this distribution.
|
|
125
|
+
where = ["."]
|
|
126
|
+
include = ["spikeforge", "spikeforge.*"]
|
|
127
|
+
exclude = ["server*", "tests*", "spikeforge_targets*", "spikeforge_hub*"]
|
|
128
|
+
|
|
129
|
+
[tool.setuptools.package-data]
|
|
130
|
+
spikeforge = ["py.typed"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Public exports for the spikeforge package."""
|
|
2
|
+
|
|
3
|
+
from spikeforge.encoding.delta_trainer import DeltaTrainer
|
|
4
|
+
from spikeforge.encoding.latency_trainer import (
|
|
5
|
+
LatencyTrainer,
|
|
6
|
+
convert_to_time,
|
|
7
|
+
)
|
|
8
|
+
from spikeforge.encoding.random_spikegen import RandomSpikeGenerator
|
|
9
|
+
from spikeforge.training.logger import SNNTrainerLogger
|
|
10
|
+
from spikeforge.training.trainer import SSNTrainer
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"SSNTrainer",
|
|
14
|
+
"SNNTrainerLogger",
|
|
15
|
+
"LatencyTrainer",
|
|
16
|
+
"DeltaTrainer",
|
|
17
|
+
"RandomSpikeGenerator",
|
|
18
|
+
"convert_to_time",
|
|
19
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Performance and memory benchmarks for the interpreter's execution modes.
|
|
2
|
+
|
|
3
|
+
This package measures wall time and memory of a topology run under
|
|
4
|
+
production and educational modes (and, opt-in, a compiled production path).
|
|
5
|
+
It is deliberately separate from ``introspection``, which describes a
|
|
6
|
+
recorded trajectory rather than the cost of producing one.
|
|
7
|
+
|
|
8
|
+
Use :func:`run_benchmark` from Python, or ``python -m
|
|
9
|
+
spikeforge.benchmark`` from a shell; both return the same
|
|
10
|
+
JSON-serialisable report.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from spikeforge.benchmark.compare import (
|
|
14
|
+
DEFAULT_THRESHOLD,
|
|
15
|
+
compare_runs,
|
|
16
|
+
exit_code,
|
|
17
|
+
)
|
|
18
|
+
from spikeforge.benchmark.config import BenchmarkConfig, default_config
|
|
19
|
+
from spikeforge.benchmark.harness import run_benchmark
|
|
20
|
+
from spikeforge.benchmark.serving import (
|
|
21
|
+
ServingBenchmarkConfig,
|
|
22
|
+
percentile,
|
|
23
|
+
run_serving_benchmark,
|
|
24
|
+
run_serving_suite,
|
|
25
|
+
)
|
|
26
|
+
from spikeforge.benchmark.store import BenchmarkStore, default_directory
|
|
27
|
+
from spikeforge.benchmark.suite import run_suite, with_metadata
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"BenchmarkConfig",
|
|
31
|
+
"BenchmarkStore",
|
|
32
|
+
"DEFAULT_THRESHOLD",
|
|
33
|
+
"ServingBenchmarkConfig",
|
|
34
|
+
"compare_runs",
|
|
35
|
+
"default_config",
|
|
36
|
+
"default_directory",
|
|
37
|
+
"exit_code",
|
|
38
|
+
"percentile",
|
|
39
|
+
"run_benchmark",
|
|
40
|
+
"run_serving_benchmark",
|
|
41
|
+
"run_serving_suite",
|
|
42
|
+
"run_suite",
|
|
43
|
+
"with_metadata",
|
|
44
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Module entry point: ``python -m spikeforge.benchmark``.
|
|
2
|
+
|
|
3
|
+
The parser and handlers live in
|
|
4
|
+
:mod:`spikeforge.benchmark.cli`; this module only exposes ``main`` so
|
|
5
|
+
the module runner and the ``spikeforge-benchmark`` console script share
|
|
6
|
+
one path.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
from spikeforge.benchmark.cli import main
|
|
12
|
+
|
|
13
|
+
if __name__ == "__main__":
|
|
14
|
+
sys.exit(main())
|