Library / Code module
Delta-rule associative memory
delta_rule_associative_memory
Store key-value pairs in a matrix with the error-correcting update M <- M + rate (v - M k) k^T, retrieve with M k, and compare with the Hebbian rule and the minimum-norm memory. Use it to test fast-weight or linear-attention memories for interference and capacity.
ATTRIBUTION.md3.9 KBLICENSE1.0 KBREADME.md3.0 KBatom_cli.py3.0 KBcomponent.json10.6 KBdelta_rule_associative_memory.py5.5 KBnumerics.py28.0 KBschema_lite.py8.9 KBtest_delta_rule_associative_memory.py3.3 KBtest_package.py12.0 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Entry points
- delta_update, hebbian_update, retrieve, store_pairs, least_squares_memory
- Known answers
- 9 cases its tests reproduce
Cases it covers
- latest pair has no crosstalk: The Hebbian sum v1 k1^T + v2 k2^T retrieves 0.6 for k2 because k1 and k2 overlap; the delta rule removes that crosstalk for the latest pair.
Limits and scope
- Limits
- Dense matrices for small key and value sizes (tens to a few hundred). Sweeps converge slowly when keys are nearly parallel. With more pairs than key dimensions the pairs cannot all be stored; sweeps then cycle instead of converging, and least_squares_memory refuses dependent keys. No forgetting, gating or decay terms are modelled.
- Guarantees
- After a delta update with rate * ||k||^2 = 1, retrieving k returns v exactly (up to rounding). Writes with keys orthogonal to k leave the retrieval of k unchanged. With unit keys and rate 1, sweeps from zero converge to least_squares_memory when the keys are independent; divergence raises ValueError.
- Assumes
- Keys and values are real vectors of fixed length; the memory starts at zero in store_pairs. Exact one-shot storage needs rate * ||k||^2 = 1; stability needs 0 < rate * ||k||^2 < 2.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/delta_rule_associative_memory
- Size
- 10 files, 79.3 KB
- Identity
library.supply.creative_originals.478cb86a446827a9ece45ab1.b492f4e762a8fad5- Version
b492f4e762a8fad567403799eaf1c67480ff864bff130733555f2dfd78aef106
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- Statistics for comparing resultsDeterministic skills
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.