Baltor Get started

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.

Files, names only

  • ATTRIBUTION.md 3.9 KB
  • LICENSE 1.0 KB
  • README.md 3.0 KB
  • atom_cli.py 3.0 KB
  • component.json 10.6 KB
  • delta_rule_associative_memory.py 5.5 KB
  • numerics.py 28.0 KB
  • schema_lite.py 8.9 KB
  • test_delta_rule_associative_memory.py 3.3 KB
  • test_package.py 12.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

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.