Class NTMReadHead<T>
- Namespace
- AiDotNet.MetaLearning.Algorithms
- Assembly
- AiDotNet.dll
NTM read head for content-based addressing.
public class NTMReadHead<T>
Type Parameters
TThe numeric type.
- Inheritance
-
NTMReadHead<T>
- Inherited Members
Constructors
NTMReadHead(int, int, int)
Initializes a new instance of NTMReadHead.
public NTMReadHead(int memoryWidth, int memorySize, int headIndex)
Parameters
memoryWidthintThe width of each memory slot.
memorySizeintThe number of memory slots.
headIndexintThe index of this read head.
Methods
Clone()
Clones the read head.
public NTMReadHead<T> Clone()
Returns
- NTMReadHead<T>
A new read head with the same configuration.
ComputeReadWeights(Tensor<T>, NTMMemory<T>)
Computes read weights using cosine similarity.
public Vector<T> ComputeReadWeights(Tensor<T> key, NTMMemory<T> memory)
Parameters
keyTensor<T>The key tensor.
memoryNTMMemory<T>The memory matrix.
Returns
- Vector<T>
The read weights vector.