canns 0.15.1__tar.gz → 1.0.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.
- {canns-0.15.1 → canns-1.0.0}/CHANGELOG.md +27 -0
- canns-1.0.0/PKG-INFO +257 -0
- canns-1.0.0/README.md +206 -0
- canns-1.0.0/README_zh.md +205 -0
- canns-0.15.1/PKG-INFO +0 -245
- canns-0.15.1/README.md +0 -194
- canns-0.15.1/README_zh.md +0 -193
- {canns-0.15.1 → canns-1.0.0}/.gitignore +0 -0
- {canns-0.15.1 → canns-1.0.0}/CITATION.cff +0 -0
- {canns-0.15.1 → canns-1.0.0}/LICENSE +0 -0
- {canns-0.15.1 → canns-1.0.0}/pyproject.toml +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/_version.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/coho.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/cohomap.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/cohomap_vectors.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/cohospace.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/cohospace_phase_centers.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/cohospace_scatter.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/config.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/decode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/embedding.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/fly_roi.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/fr.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/path.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/plotting.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/tda.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/asa/utils.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/btn.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/grid_cells.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/grid_modules_leiden.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/head_direction.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/core/spatial_analysis.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/io/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/io/matlab_loader.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/utils/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/utils/circular_stats.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/utils/correlation.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/utils/geometry.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/utils/image_processing.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/visualization/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/visualization/btn_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/visualization/grid_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/data/cell_classification/visualization/hd_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/metrics/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/metrics/spatial_metrics.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/metrics/systematic_ratemap.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/metrics/utils.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/model_specific/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/model_specific/hopfield.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/slow_points/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/slow_points/checkpoint.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/slow_points/finder.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/slow_points/fixed_points.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/slow_points/visualization.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/animation.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/backend.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/config.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/jupyter_utils.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/rendering.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/core/writers.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/energy_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/spatial_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/spike_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/theta_sweep_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/analyzer/visualization/tuning_plots.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/data/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/data/datasets.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/data/loaders.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/_base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/cann.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/grid_cell.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/hierarchical_model.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/basic/theta_sweep_model.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/brain_inspired/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/brain_inspired/_base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/brain_inspired/hopfield.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/brain_inspired/linear.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/brain_inspired/spiking.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/models/hybrid/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/__main__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/__main__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/app.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/runner.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/screens.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/state.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/styles.tcss +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa/widgets.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/__main__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/batch_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/cohomap_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/cohospace_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/decode_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/fr_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/frm_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/gridscore_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/pathcompare_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/analysis_modes/tda_mode.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/app.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/controllers/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/controllers/analysis_controller.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/controllers/preprocess_controller.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/core/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/core/cache.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/core/runner.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/core/state.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/core/worker.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/main_window.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/models/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/models/config.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/models/job.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/models/presets.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/dark.qss +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/light.qss +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/logo.ico +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/logo.svg +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/resources/styles.qss +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/utils/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/utils/formatters.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/utils/io_adapters.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/utils/validators.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/help_content.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/pages/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/pages/analysis_page.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/pages/preprocess_page.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/panels/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/artifacts_tab.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/drop_zone.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/file_list.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/gridscore_tab.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/help_dialog.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/image_tab.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/image_viewer.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/log_box.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/pathcompare_tab.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/asa_gui/views/widgets/popup_combo.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/__main__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/app.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/runner.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/state.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/gallery/styles.tcss +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/pipeline/launcher.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/py.typed +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/_base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/closed_loop_navigation.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/navigation_base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/open_loop_navigation.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/task/tracking.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/_base.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/bcm.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/hebbian.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/oja.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/sanger.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/stdp.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/trainer/utils.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/typing/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/utils/__init__.py +0 -0
- {canns-0.15.1 → canns-1.0.0}/src/canns/utils/benchmark.py +0 -0
|
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.0] - 2026-02-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Architecture diagram (`images/architecture.png`) explaining modular design principles
|
|
12
|
+
- Comprehensive analyzer visualization showcase (`images/analyzer-display.png`, 4.7MB)
|
|
13
|
+
- ASA GUI preview animation (`images/asa-gui.gif`, 898KB)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **Production Ready Milestone**: v1.0.0 marks API stability and production readiness
|
|
17
|
+
- Complete README restructure (both English and Chinese) with improved project overview
|
|
18
|
+
- Enhanced Quick Start example with better comments and complete workflow demonstration
|
|
19
|
+
- Updated status badge from "beta" to "stable" in README.md and README_zh.md
|
|
20
|
+
- Improved visual gallery presentation with richer analyzer capability showcase
|
|
21
|
+
- Reorganized README sections: Overview, Architecture, Core Features, Analyzer Visuals, Quick Start
|
|
22
|
+
|
|
23
|
+
## [0.15.1] - 2026-02-01
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Refactored ASA module: removed legacy aliases and consolidated utilities (PR #95)
|
|
27
|
+
- Replaced custom Gaussian filter with scipy public API
|
|
28
|
+
- Added comprehensive docstrings to key private functions
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- Reduced PyPI package size by excluding unnecessary files
|
|
32
|
+
|
|
8
33
|
## [0.15.0] - 2026-01-31
|
|
9
34
|
|
|
10
35
|
### Added
|
|
@@ -577,6 +602,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
577
602
|
- Basic structure template
|
|
578
603
|
- Core application structure
|
|
579
604
|
|
|
605
|
+
[1.0.0]: https://github.com/routhleck/canns/compare/v0.15.1...v1.0.0
|
|
606
|
+
[0.15.1]: https://github.com/routhleck/canns/compare/v0.15.0...v0.15.1
|
|
580
607
|
[0.15.0]: https://github.com/routhleck/canns/compare/v0.14.3...v0.15.0
|
|
581
608
|
[0.14.3]: https://github.com/routhleck/canns/compare/v0.14.2...v0.14.3
|
|
582
609
|
[0.14.2]: https://github.com/routhleck/canns/compare/v0.14.1...v0.14.2
|
canns-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: canns
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A Python Library for Continuous Attractor Neural Networks
|
|
5
|
+
Project-URL: Repository, https://github.com/routhleck/canns
|
|
6
|
+
Author-email: Sichao He <sichaohe@outlook.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: <4.0,>=3.11
|
|
19
|
+
Requires-Dist: brainpy[cpu]
|
|
20
|
+
Requires-Dist: canns-lib>=0.6.2
|
|
21
|
+
Requires-Dist: climage>=0.2.2
|
|
22
|
+
Requires-Dist: furo>=2025.7.19
|
|
23
|
+
Requires-Dist: h5py>=3.7
|
|
24
|
+
Requires-Dist: igraph>=1.0.0
|
|
25
|
+
Requires-Dist: imageio[ffmpeg]>=2.37.0
|
|
26
|
+
Requires-Dist: leidenalg>=0.11.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.5
|
|
28
|
+
Requires-Dist: notebook>=7.4.4
|
|
29
|
+
Requires-Dist: numba>=0.56.0
|
|
30
|
+
Requires-Dist: numpy<2.3,>=1.24
|
|
31
|
+
Requires-Dist: scikit-image>=0.19
|
|
32
|
+
Requires-Dist: scipy>=1.9.0
|
|
33
|
+
Requires-Dist: seaborn>=0.13.2
|
|
34
|
+
Requires-Dist: textual>=7.3.0
|
|
35
|
+
Requires-Dist: tqdm
|
|
36
|
+
Provides-Extra: cpu
|
|
37
|
+
Requires-Dist: brainpy[cpu]; extra == 'cpu'
|
|
38
|
+
Provides-Extra: cuda12
|
|
39
|
+
Requires-Dist: brainpy[cuda12]; (platform_system == 'Linux') and extra == 'cuda12'
|
|
40
|
+
Provides-Extra: cuda13
|
|
41
|
+
Requires-Dist: brainpy[cuda13]; (platform_system == 'Linux') and extra == 'cuda13'
|
|
42
|
+
Provides-Extra: gui
|
|
43
|
+
Requires-Dist: imageio; extra == 'gui'
|
|
44
|
+
Requires-Dist: pillow; extra == 'gui'
|
|
45
|
+
Requires-Dist: pyside6>=6.6.0; extra == 'gui'
|
|
46
|
+
Requires-Dist: qtawesome; extra == 'gui'
|
|
47
|
+
Requires-Dist: requests>=2.31.0; extra == 'gui'
|
|
48
|
+
Provides-Extra: tpu
|
|
49
|
+
Requires-Dist: brainpy[tpu]; (platform_system == 'Linux') and extra == 'tpu'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# CANNs: Continuous Attractor Neural Networks Toolkit
|
|
53
|
+
|
|
54
|
+
<div align="center">
|
|
55
|
+
<img src="images/logo.svg" alt="CANNs Logo" width="350">
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
[<img src="https://badges.ws/badge/status-stable-green" />](https://github.com/routhleck/canns)
|
|
59
|
+

|
|
60
|
+
[<img src="https://badges.ws/maintenance/yes/2026" />](https://github.com/routhleck/canns)
|
|
61
|
+
<picture><img src="https://badges.ws/github/release/routhleck/canns" /></picture>
|
|
62
|
+
<picture><img src="https://badges.ws/github/license/routhleck/canns" /></picture>
|
|
63
|
+
[](https://doi.org/10.5281/zenodo.17412545)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<picture><img src="https://badges.ws/github/stars/routhleck/canns?logo=github" /></picture>
|
|
67
|
+
[](https://pepy.tech/projects/canns)
|
|
68
|
+
[](https://deepwiki.com/Routhleck/canns)
|
|
69
|
+
[<img src="https://badges.ws/badge/Buy_Me_a_Coffee-ff813f?icon=buymeacoffee" />](https://buymeacoffee.com/forrestcai6)
|
|
70
|
+
|
|
71
|
+
> 中文说明请见 [README_zh.md](README_zh.md)
|
|
72
|
+
|
|
73
|
+
## Overview
|
|
74
|
+
|
|
75
|
+
CANNs (Continuous Attractor Neural Networks toolkit) is a research toolkit built on [BrainPy](https://github.com/brainpy/BrainPy) and [JAX](https://github.com/jax-ml/jax), with optional Rust-accelerated [`canns-lib`](https://github.com/Routhleck/canns-lib) for selected performance-critical routines (e.g., TDA/Ripser and task generation). It bundles model collections, task generators, analyzers, and the ASA pipeline (GUI/TUI) so researchers can run simulations and analyze results in a consistent workflow. The API separates models, tasks, analyzers, and trainers to keep experiments modular and extensible.
|
|
76
|
+
|
|
77
|
+
## Architecture
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img src="images/architecture.png" alt="CANNs Architecture" width="900">
|
|
81
|
+
<br>
|
|
82
|
+
<span style="color: grey; font-size: 14px;">Library architecture overview: models, tasks, analyzers, trainers, and pipeline built on BrainPy/JAX with optional Rust acceleration.</span>
|
|
83
|
+
</p>
|
|
84
|
+
|
|
85
|
+
The CANNs library follows a modular architecture guided by two core principles: **separation of concerns** and **extensibility through
|
|
86
|
+
base classes**. The design separates functional responsibilities into five independent modules:
|
|
87
|
+
1. **Models** (`canns.models`) define neural network dynamics;
|
|
88
|
+
2. **Tasks** (`canns.task`) generate experimental paradigms and input data;
|
|
89
|
+
3. **Analyzers** (`canns.analyzer`) provide visualization and analysis tools;
|
|
90
|
+
4. **Trainers** (`canns.trainer`) implement learning rules for brain-inspired models;
|
|
91
|
+
5. **Pipeline** (`canns.pipeline`) orchestrates complete workflows.
|
|
92
|
+
|
|
93
|
+
Each module focuses on a single responsibility—models don't generate input data, tasks don't analyze results, and analyzers don't modify
|
|
94
|
+
parameters. This separation ensures maintainability, testability, and extensibility. All major components inherit from abstract base classes
|
|
95
|
+
(`BasicModel`, `BrainInspiredModel`, `Trainer`) that define standard interfaces, enabling users to create custom implementations that
|
|
96
|
+
seamlessly integrate with the built-in ecosystem.
|
|
97
|
+
|
|
98
|
+
## Core Features
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
- **Model collections**: basic CANNs (1D/2D, SFA), hierarchical path integration, theta-sweep models, brain-inspired models (e.g., Amari-Hopfield, linear/spiking layers)
|
|
103
|
+
- **Task generators**: smooth tracking, population coding, template matching, open/closed-loop navigation
|
|
104
|
+
- **Analyzer suite**: energy landscapes, tuning curves, raster/firing-rate plots, TDA and decoding utilities, cell classification
|
|
105
|
+
- **ASA pipeline & GUI/TUI**: end-to-end workflow for preprocessing, TDA, decoding, and result visualization (e.g., CohoMap/CohoSpace/PathCompare/FR/FRM/GridScore)
|
|
106
|
+
- **Training & extensibility**: HebbianTrainer plus base classes for consistent extension
|
|
107
|
+
- **Optional acceleration**: `canns-lib` for selected performance-critical routines
|
|
108
|
+
|
|
109
|
+
## Analyzer Visuals
|
|
110
|
+
|
|
111
|
+
<p align="center">
|
|
112
|
+
<img src="docs/_static/figure2_full.png" alt="Model Analysis Overview" width="900">
|
|
113
|
+
<br>
|
|
114
|
+
<span style="color: grey; font-size: 14px;">Overview of Neural Dynamics Models. Comparison of three basic models: (A) 1D CANN, (B) 2D CANN, and (C) Grid Cell Network</span>
|
|
115
|
+
</p>
|
|
116
|
+
|
|
117
|
+
<p align="center">
|
|
118
|
+
<img src="images/analyzer-display.png" alt="Analyzer Display" width="900">
|
|
119
|
+
<br>
|
|
120
|
+
<span style="color: grey; font-size: 14px;">Rich Analyzer Visualization Results</span>
|
|
121
|
+
</p>
|
|
122
|
+
<p align="center">
|
|
123
|
+
<img src="images/asa-gui.gif" alt="ASA GUI Preview" width="720">
|
|
124
|
+
<br>
|
|
125
|
+
<span style="color: grey; font-size: 14px;">ASA GUI preview</span>
|
|
126
|
+
</p>
|
|
127
|
+
<p align="center">
|
|
128
|
+
<a href="https://youtu.be/OoEo5Qa9f7M">
|
|
129
|
+
<img src="https://img.youtube.com/vi/OoEo5Qa9f7M/hqdefault.jpg" alt="ASA GUI Demo (YouTube)" width="720">
|
|
130
|
+
</a>
|
|
131
|
+
<br>
|
|
132
|
+
<span style="color: grey; font-size: 14px;">ASA GUI demo video</span>
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
<div align="center">
|
|
136
|
+
<table>
|
|
137
|
+
<tr>
|
|
138
|
+
<td align="center" width="50%" valign="top">
|
|
139
|
+
<h4>Smooth Tracking 1D</h4>
|
|
140
|
+
<img src="docs/_static/smooth_tracking_1d.gif" alt="Smooth Tracking 1D" width="320">
|
|
141
|
+
<br><em>Activity bump following a moving stimulus</em>
|
|
142
|
+
</td>
|
|
143
|
+
<td align="center" width="50%" valign="top">
|
|
144
|
+
<h4>CANN2D Encoding</h4>
|
|
145
|
+
<img src="docs/_static/CANN2D_encoding.gif" alt="CANN2D Encoding" width="320">
|
|
146
|
+
<br><em>2D population encoding patterns over time</em>
|
|
147
|
+
</td>
|
|
148
|
+
</tr>
|
|
149
|
+
<tr>
|
|
150
|
+
<td colspan="2" align="center">
|
|
151
|
+
<h4>Theta Sweep Animation</h4>
|
|
152
|
+
<img src="docs/_static/theta_sweep_animation.gif" alt="Theta Sweep Animation" width="600">
|
|
153
|
+
<br><em>Theta-modulated sweep dynamics</em>
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr>
|
|
157
|
+
<td align="center" width="50%" valign="top">
|
|
158
|
+
<h4>Bump Analysis</h4>
|
|
159
|
+
<img src="docs/_static/bump_analysis_demo.gif" alt="Bump Analysis Demo" width="320">
|
|
160
|
+
<br><em>Bump fitting and stability diagnostics</em>
|
|
161
|
+
</td>
|
|
162
|
+
<td align="center" width="50%" valign="top">
|
|
163
|
+
<h4>Torus Bump</h4>
|
|
164
|
+
<img src="docs/_static/torus_bump.gif" alt="Torus Bump" width="320">
|
|
165
|
+
<br><em>Bump dynamics projected onto a torus manifold</em>
|
|
166
|
+
</td>
|
|
167
|
+
</tr>
|
|
168
|
+
</table>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
## Quick Start
|
|
172
|
+
|
|
173
|
+
1D CANN smooth tracking (imports → simulation → visualization)
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
import brainpy.math as bm
|
|
177
|
+
from canns.analyzer.visualization import PlotConfigs, energy_landscape_1d_animation
|
|
178
|
+
from canns.models.basic import CANN1D
|
|
179
|
+
from canns.task.tracking import SmoothTracking1D
|
|
180
|
+
|
|
181
|
+
# simulation time step
|
|
182
|
+
bm.set_dt(0.1)
|
|
183
|
+
|
|
184
|
+
# build model
|
|
185
|
+
cann = CANN1D(num=512)
|
|
186
|
+
|
|
187
|
+
# build tracking task (Iext length = duration length + 1)
|
|
188
|
+
task = SmoothTracking1D(
|
|
189
|
+
cann_instance=cann,
|
|
190
|
+
Iext=(0.0, 0.5, 1.0, 1.5),
|
|
191
|
+
duration=(5.0, 5.0, 5.0),
|
|
192
|
+
time_step=bm.get_dt(),
|
|
193
|
+
)
|
|
194
|
+
task.get_data()
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# one-step simulation callback
|
|
198
|
+
def step(t, stimulus):
|
|
199
|
+
cann(stimulus)
|
|
200
|
+
return cann.u.value, cann.inp.value
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
# run simulation loop
|
|
204
|
+
us, inputs = bm.for_loop(
|
|
205
|
+
step,
|
|
206
|
+
operands=(task.run_steps, task.data),
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
# visualize with energy landscape animation
|
|
210
|
+
config = PlotConfigs.energy_landscape_1d_animation(
|
|
211
|
+
time_steps_per_second=int(1 / bm.get_dt()),
|
|
212
|
+
fps=20,
|
|
213
|
+
title="Smooth Tracking 1D",
|
|
214
|
+
xlabel="State",
|
|
215
|
+
ylabel="Activity",
|
|
216
|
+
show=True,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
energy_landscape_1d_animation(
|
|
220
|
+
data_sets={"u": (cann.x, us), "Iext": (cann.x, inputs)},
|
|
221
|
+
config=config,
|
|
222
|
+
)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Installation
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# CPU-only
|
|
229
|
+
pip install canns
|
|
230
|
+
|
|
231
|
+
# Optional accelerators (Linux)
|
|
232
|
+
pip install "canns[cuda12]"
|
|
233
|
+
pip install "canns[cuda13]"
|
|
234
|
+
pip install "canns[tpu]"
|
|
235
|
+
|
|
236
|
+
# GUI (ASA Pipeline)
|
|
237
|
+
pip install "canns[gui]"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Optional (uv):
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
uv pip install canns
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Docs & Examples
|
|
247
|
+
|
|
248
|
+
- Documentation and tutorials: <https://routhleck.com/canns/>
|
|
249
|
+
- Local scripts: `examples/`
|
|
250
|
+
- Sphinx docs and notebooks: `docs/`
|
|
251
|
+
- ASA GUI entry: `canns-gui`
|
|
252
|
+
|
|
253
|
+
## Contributing & License
|
|
254
|
+
|
|
255
|
+
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
|
|
256
|
+
|
|
257
|
+
Apache License 2.0. See [LICENSE](LICENSE).
|
canns-1.0.0/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# CANNs: Continuous Attractor Neural Networks Toolkit
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="images/logo.svg" alt="CANNs Logo" width="350">
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
[<img src="https://badges.ws/badge/status-stable-green" />](https://github.com/routhleck/canns)
|
|
8
|
+

|
|
9
|
+
[<img src="https://badges.ws/maintenance/yes/2026" />](https://github.com/routhleck/canns)
|
|
10
|
+
<picture><img src="https://badges.ws/github/release/routhleck/canns" /></picture>
|
|
11
|
+
<picture><img src="https://badges.ws/github/license/routhleck/canns" /></picture>
|
|
12
|
+
[](https://doi.org/10.5281/zenodo.17412545)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<picture><img src="https://badges.ws/github/stars/routhleck/canns?logo=github" /></picture>
|
|
16
|
+
[](https://pepy.tech/projects/canns)
|
|
17
|
+
[](https://deepwiki.com/Routhleck/canns)
|
|
18
|
+
[<img src="https://badges.ws/badge/Buy_Me_a_Coffee-ff813f?icon=buymeacoffee" />](https://buymeacoffee.com/forrestcai6)
|
|
19
|
+
|
|
20
|
+
> 中文说明请见 [README_zh.md](README_zh.md)
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
CANNs (Continuous Attractor Neural Networks toolkit) is a research toolkit built on [BrainPy](https://github.com/brainpy/BrainPy) and [JAX](https://github.com/jax-ml/jax), with optional Rust-accelerated [`canns-lib`](https://github.com/Routhleck/canns-lib) for selected performance-critical routines (e.g., TDA/Ripser and task generation). It bundles model collections, task generators, analyzers, and the ASA pipeline (GUI/TUI) so researchers can run simulations and analyze results in a consistent workflow. The API separates models, tasks, analyzers, and trainers to keep experiments modular and extensible.
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<img src="images/architecture.png" alt="CANNs Architecture" width="900">
|
|
30
|
+
<br>
|
|
31
|
+
<span style="color: grey; font-size: 14px;">Library architecture overview: models, tasks, analyzers, trainers, and pipeline built on BrainPy/JAX with optional Rust acceleration.</span>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
The CANNs library follows a modular architecture guided by two core principles: **separation of concerns** and **extensibility through
|
|
35
|
+
base classes**. The design separates functional responsibilities into five independent modules:
|
|
36
|
+
1. **Models** (`canns.models`) define neural network dynamics;
|
|
37
|
+
2. **Tasks** (`canns.task`) generate experimental paradigms and input data;
|
|
38
|
+
3. **Analyzers** (`canns.analyzer`) provide visualization and analysis tools;
|
|
39
|
+
4. **Trainers** (`canns.trainer`) implement learning rules for brain-inspired models;
|
|
40
|
+
5. **Pipeline** (`canns.pipeline`) orchestrates complete workflows.
|
|
41
|
+
|
|
42
|
+
Each module focuses on a single responsibility—models don't generate input data, tasks don't analyze results, and analyzers don't modify
|
|
43
|
+
parameters. This separation ensures maintainability, testability, and extensibility. All major components inherit from abstract base classes
|
|
44
|
+
(`BasicModel`, `BrainInspiredModel`, `Trainer`) that define standard interfaces, enabling users to create custom implementations that
|
|
45
|
+
seamlessly integrate with the built-in ecosystem.
|
|
46
|
+
|
|
47
|
+
## Core Features
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
- **Model collections**: basic CANNs (1D/2D, SFA), hierarchical path integration, theta-sweep models, brain-inspired models (e.g., Amari-Hopfield, linear/spiking layers)
|
|
52
|
+
- **Task generators**: smooth tracking, population coding, template matching, open/closed-loop navigation
|
|
53
|
+
- **Analyzer suite**: energy landscapes, tuning curves, raster/firing-rate plots, TDA and decoding utilities, cell classification
|
|
54
|
+
- **ASA pipeline & GUI/TUI**: end-to-end workflow for preprocessing, TDA, decoding, and result visualization (e.g., CohoMap/CohoSpace/PathCompare/FR/FRM/GridScore)
|
|
55
|
+
- **Training & extensibility**: HebbianTrainer plus base classes for consistent extension
|
|
56
|
+
- **Optional acceleration**: `canns-lib` for selected performance-critical routines
|
|
57
|
+
|
|
58
|
+
## Analyzer Visuals
|
|
59
|
+
|
|
60
|
+
<p align="center">
|
|
61
|
+
<img src="docs/_static/figure2_full.png" alt="Model Analysis Overview" width="900">
|
|
62
|
+
<br>
|
|
63
|
+
<span style="color: grey; font-size: 14px;">Overview of Neural Dynamics Models. Comparison of three basic models: (A) 1D CANN, (B) 2D CANN, and (C) Grid Cell Network</span>
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
<p align="center">
|
|
67
|
+
<img src="images/analyzer-display.png" alt="Analyzer Display" width="900">
|
|
68
|
+
<br>
|
|
69
|
+
<span style="color: grey; font-size: 14px;">Rich Analyzer Visualization Results</span>
|
|
70
|
+
</p>
|
|
71
|
+
<p align="center">
|
|
72
|
+
<img src="images/asa-gui.gif" alt="ASA GUI Preview" width="720">
|
|
73
|
+
<br>
|
|
74
|
+
<span style="color: grey; font-size: 14px;">ASA GUI preview</span>
|
|
75
|
+
</p>
|
|
76
|
+
<p align="center">
|
|
77
|
+
<a href="https://youtu.be/OoEo5Qa9f7M">
|
|
78
|
+
<img src="https://img.youtube.com/vi/OoEo5Qa9f7M/hqdefault.jpg" alt="ASA GUI Demo (YouTube)" width="720">
|
|
79
|
+
</a>
|
|
80
|
+
<br>
|
|
81
|
+
<span style="color: grey; font-size: 14px;">ASA GUI demo video</span>
|
|
82
|
+
</p>
|
|
83
|
+
|
|
84
|
+
<div align="center">
|
|
85
|
+
<table>
|
|
86
|
+
<tr>
|
|
87
|
+
<td align="center" width="50%" valign="top">
|
|
88
|
+
<h4>Smooth Tracking 1D</h4>
|
|
89
|
+
<img src="docs/_static/smooth_tracking_1d.gif" alt="Smooth Tracking 1D" width="320">
|
|
90
|
+
<br><em>Activity bump following a moving stimulus</em>
|
|
91
|
+
</td>
|
|
92
|
+
<td align="center" width="50%" valign="top">
|
|
93
|
+
<h4>CANN2D Encoding</h4>
|
|
94
|
+
<img src="docs/_static/CANN2D_encoding.gif" alt="CANN2D Encoding" width="320">
|
|
95
|
+
<br><em>2D population encoding patterns over time</em>
|
|
96
|
+
</td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<td colspan="2" align="center">
|
|
100
|
+
<h4>Theta Sweep Animation</h4>
|
|
101
|
+
<img src="docs/_static/theta_sweep_animation.gif" alt="Theta Sweep Animation" width="600">
|
|
102
|
+
<br><em>Theta-modulated sweep dynamics</em>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
<tr>
|
|
106
|
+
<td align="center" width="50%" valign="top">
|
|
107
|
+
<h4>Bump Analysis</h4>
|
|
108
|
+
<img src="docs/_static/bump_analysis_demo.gif" alt="Bump Analysis Demo" width="320">
|
|
109
|
+
<br><em>Bump fitting and stability diagnostics</em>
|
|
110
|
+
</td>
|
|
111
|
+
<td align="center" width="50%" valign="top">
|
|
112
|
+
<h4>Torus Bump</h4>
|
|
113
|
+
<img src="docs/_static/torus_bump.gif" alt="Torus Bump" width="320">
|
|
114
|
+
<br><em>Bump dynamics projected onto a torus manifold</em>
|
|
115
|
+
</td>
|
|
116
|
+
</tr>
|
|
117
|
+
</table>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
## Quick Start
|
|
121
|
+
|
|
122
|
+
1D CANN smooth tracking (imports → simulation → visualization)
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
import brainpy.math as bm
|
|
126
|
+
from canns.analyzer.visualization import PlotConfigs, energy_landscape_1d_animation
|
|
127
|
+
from canns.models.basic import CANN1D
|
|
128
|
+
from canns.task.tracking import SmoothTracking1D
|
|
129
|
+
|
|
130
|
+
# simulation time step
|
|
131
|
+
bm.set_dt(0.1)
|
|
132
|
+
|
|
133
|
+
# build model
|
|
134
|
+
cann = CANN1D(num=512)
|
|
135
|
+
|
|
136
|
+
# build tracking task (Iext length = duration length + 1)
|
|
137
|
+
task = SmoothTracking1D(
|
|
138
|
+
cann_instance=cann,
|
|
139
|
+
Iext=(0.0, 0.5, 1.0, 1.5),
|
|
140
|
+
duration=(5.0, 5.0, 5.0),
|
|
141
|
+
time_step=bm.get_dt(),
|
|
142
|
+
)
|
|
143
|
+
task.get_data()
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# one-step simulation callback
|
|
147
|
+
def step(t, stimulus):
|
|
148
|
+
cann(stimulus)
|
|
149
|
+
return cann.u.value, cann.inp.value
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# run simulation loop
|
|
153
|
+
us, inputs = bm.for_loop(
|
|
154
|
+
step,
|
|
155
|
+
operands=(task.run_steps, task.data),
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# visualize with energy landscape animation
|
|
159
|
+
config = PlotConfigs.energy_landscape_1d_animation(
|
|
160
|
+
time_steps_per_second=int(1 / bm.get_dt()),
|
|
161
|
+
fps=20,
|
|
162
|
+
title="Smooth Tracking 1D",
|
|
163
|
+
xlabel="State",
|
|
164
|
+
ylabel="Activity",
|
|
165
|
+
show=True,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
energy_landscape_1d_animation(
|
|
169
|
+
data_sets={"u": (cann.x, us), "Iext": (cann.x, inputs)},
|
|
170
|
+
config=config,
|
|
171
|
+
)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Installation
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# CPU-only
|
|
178
|
+
pip install canns
|
|
179
|
+
|
|
180
|
+
# Optional accelerators (Linux)
|
|
181
|
+
pip install "canns[cuda12]"
|
|
182
|
+
pip install "canns[cuda13]"
|
|
183
|
+
pip install "canns[tpu]"
|
|
184
|
+
|
|
185
|
+
# GUI (ASA Pipeline)
|
|
186
|
+
pip install "canns[gui]"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Optional (uv):
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
uv pip install canns
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Docs & Examples
|
|
196
|
+
|
|
197
|
+
- Documentation and tutorials: <https://routhleck.com/canns/>
|
|
198
|
+
- Local scripts: `examples/`
|
|
199
|
+
- Sphinx docs and notebooks: `docs/`
|
|
200
|
+
- ASA GUI entry: `canns-gui`
|
|
201
|
+
|
|
202
|
+
## Contributing & License
|
|
203
|
+
|
|
204
|
+
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
|
|
205
|
+
|
|
206
|
+
Apache License 2.0. See [LICENSE](LICENSE).
|