A biologically-plausible vector hashing framework for associative memory and bio-inspired SLAM, developed as part of the RatSLAM 2.0 COMP 400 honors project at McGill University.
VectorHaSH provides a neocortical-hippocampal-entorhinal memory scaffold that stores sensory observations in a distributed, denoising-friendly representation. The framework is built around:
vectorhash.py– the coreVectorHaSHclass (store_memory, recall, denoising, and dream/fix modes).clean_scaffold.py–GridHippocampalScaffoldmodeling entorhinal grid cells over a toroidal attractor network.hippocampal_sensory_layers.py–HippocampalSensoryLayerfor Hebbian / analytic / iterative pseudoinverse learning between the hippocampus and sensory inputs.shifts.py– velocity-driven continuous attractor dynamics for path integration.graph_utils.py/grid_module.py– topological graph building and grid-module utilities used for SLAM loop-closure and pose tracking.
Experiments (capacity scaling, learning-rule benchmarks, and SLAM evaluations in AnimalAI) are in the notebooks and experiments/, kidnapping_tests/, and results/ directories.
RatSLAM 2.0 pose tracking in AnimalAI — a test path with the agent's true vs. predicted camera view, plus the estimated x, y, and heading distributions tracked by the hippocampal grid code:
Grid-module dynamics — the entorhinal grid-cell continuous attractor network (CAN) sustains a localized activity bump that drifts with velocity input (path integration). Left: a bump circulating under rotational velocity input. Right: bump stabilization/repair via the Burak & Fiete healer.
![]() |
![]() |
|---|---|
| circular velocity drive | stabilization by healer |
Shift dynamics — how new sensory evidence moves the grid-cell bump: additive shift vs. multiplicative shift of the one-hot grid representation.
![]() |
![]() |
|---|---|
| additive shift | multiplicative shift |
Full write-up, abstract, and presentation slides: Research & Publications – RatSLAM 2.0 (VectorHaSH & Bio-Plausible SLAM)
Python + PyTorch, with scipy, numpy, and matplotlib. See environment-aai-linux.yml for a full conda environment.
@techreport{huang2025ratslam2,
title={COMP 400 Final Report: RatSlam 2.0 (VectorHaSH \& Bio-Plausible SLAM)},
author={Huang, Ezra and Lamontagne-Kratz, Jonathan and Lefevre, Olivier and Premont-Schwarz, Isabeau},
institution={McGill University School of Computer Science},
type={COMP 400 Final Report},
month={May},
year={2025},
url={https://github.com/epicgamer17/vectorhash}
}Note: the
kidnapping_tests/,kidnapping_tests_identity_smoothing/,results/, andhypers_searching/directories contain generated experiment outputs (.pklcheckpoints,.ziparchives) and are gitignored. They are recreated by running the notebooks.




