AssociativeMemory<T>
Models & Types · AiDotNet.NestedLearning
Implementation of Associative Memory for nested learning using modern continuous Hopfield retrieval (Ramsauer et al. 2021). Stores key-value pairs and retrieves via softmax attention: new_state = softmax(β * keys^T @ query) @ values.
Inheritance: NestedLearningBase<T> → AssociativeMemory<T>
Implements: IAssociativeMemory<T>
Constructors
| Constructor | Summary |
|---|---|
AssociativeMemory(int dimension, int capacity, double inverseTemperature) |
Properties
| Property | Summary |
|---|---|
int Capacity { get; } |
|
int MemoryCount { get; } |
Gets the number of stored memories. |
Methods
| Method | Summary |
|---|---|
Matrix<T> GetAssociationMatrix() |
Computes the Hebbian association matrix from stored memories: W = Σ target_i * input_i^T. |
Vector<T> Retrieve(Vector<T> query) |
|
void Associate(Vector<T> input, Vector<T> target) |
|
void Clear() |
|
void Update(Vector<T> input, Vector<T> target, T learningRate) |