Back to Registry
View Author Profile
Official Verified
Ntm Memory System
Skill by 1580021414-afk
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/1580021414-afk/ntm-memory-systemOr
name: ntm-memory-system description: 基于 Neural Turing Machines 的外部记忆系统,让 AI 具备可读写的外部记忆能力 metadata: openclaw: emoji: "🧠" category: "AI-Core" version: "1.0.0" author: "小钳" paper: "Neural Turing Machines (Graves et al., 2014)" price: 0 contact: "微信 17612824848" tags: - 外部记忆 - 神经图灵机 - 可微分计算 - 算法学习
Neural Turing Machines Memory System
基于 DeepMind 的 Neural Turing Machines 论文,为 AI 提供可读写的外部记忆能力。
一、核心概念
1.1 什么是 Neural Turing Machine?
NTM 将神经网络与外部记忆资源耦合:
┌─────────────────────────────────────────────────────┐
│ Neural Turing Machine │
├─────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ 读写头 ┌─────────────┐ │
│ │ │ ◄─────────────► │ │ │
│ │ Controller │ │ Memory │ │
│ │ (神经网络) │ │ Matrix │ │
│ │ │ │ (N × M) │ │
│ └─────────────┘ └─────────────┘ │
│ ▲ │ │
│ │ │ │
│ └───────────────────────────────┘ │
│ 注意力机制 │
└─────────────────────────────────────────────────────┘
1.2 关键特性
| 特性 | 说明 |
|---|---|
| 可微分 | 端到端训练,梯度下降优化 |
| 外部记忆 | 突破神经网络隐藏层大小限制 |
| 注意力寻址 | 内容寻址 + 位置寻址 |
| 算法学习 | 能学习复制、排序、关联回忆等算法 |
二、记忆架构
2.1 记忆矩阵
interface MemoryMatrix {
// 记忆矩阵: N 个位置,每个位置 M 维
memory: number[][]; // N × M
// 权重向量: 读/写头的注意力分布
weights: number[]; // N 维,和为1
// 读写头状态
heads: {
read: ReadHead;
write: WriteHead;
};
}
2.2 寻址机制
interface AddressingMechanism {
// 1. 内容寻址 - 根据相似度
contentAddressing(key: number[], memory: number[][]): number[] {
// 计算余弦相似度
const similarities = memory.map(row =>
cosineSimilarity(key, row)
);
// softmax 得到权重
return softmax(similarities.map(s => s * beta)); // beta = 关注强度
}
// 2. 位置寻址 - 根据位置偏移
locationAddressing(weights: number[], shift: number): number[] {
// 循环移位
return circularShift(weights, shift);
}
// 3. 混合寻址
gatedAddressing(
contentWeights: number[],
locationWeights: number[],
gate: number
): number[] {
return contentWeights.map((w, i) =>
gate * w + (1 - gate) * locationWeights[i]
);
}
}
2.3 读写操作
interface ReadHead {
// 从记忆中读取
read(memory: number[][], weights: number[]): number[] {
// 加权求和
return memory[0].map((_, j) =>
weights.reduce((sum, w, i) => sum + w * memory[i][j], 0)
);
}
}
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-1580021414-afk-ntm-memory-system": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.