-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappendix-e.html
More file actions
468 lines (420 loc) · 17.6 KB
/
Copy pathappendix-e.html
File metadata and controls
468 lines (420 loc) · 17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="AI学习笔记 - 从零开始系统学习人工智能,涵盖前置基础、核心原理、工程实践、应用工具、进阶展望">
<meta name="keywords" content="AI, 人工智能, 机器学习, 深度学习, Python, 数学基础">
<meta name="author" content="AI Learner">
<title>附录E:在线运行环境 - AI学习笔记</title>
<!-- Google Fonts - Inter -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<!-- KaTeX - 轻量级数学公式渲染 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"
onload="renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '\\[', right: '\\]', display: true},
{left: '\\(', right: '\\)', display: false},
{left: '$', right: '$', display: false}
],
throwOnError: false
});"></script>
<!-- Prism.js 代码高亮 - tomorrow-night 主题 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js"></script>
<!-- 自定义样式表 -->
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/dark-mode.css">
<link rel="stylesheet" href="../../css/mobile-optimizations.css">
<!-- 内联CSS样式 -->
<!-- AI-Notes共享样式 -->
<link rel="stylesheet" href="../assets/ai-notes.css">
</head>
<body>
<!-- ==================== 导航栏 ==================== -->
<nav class="ai-nav">
<a href="../../index.html" class="ai-nav-brand">
<i class="fas fa-brain"></i>
AI学习笔记
</a>
<ul class="ai-nav-links" id="navLinks">
<li><a href="../../index.html"><i class="fas fa-home"></i> 首页</a></li>
<li><a href="ch15.html"><i class="fas fa-robot"></i> Agent</a></li>
<li><a href="ch16.html"><i class="fas fa-tools"></i> 工具</a></li>
<li><a href="ch17.html"><i class="fas fa-book-open"></i> 知识库</a></li>
<li><a href="ch18.html"><i class="fas fa-layer-group"></i> 记忆</a></li>
<li><a href="ch19.html"><i class="fas fa-comment-dots"></i> 提示</a></li>
<li><a href="ch20.html"><i class="fas fa-database"></i> 数据</a></li>
<li><a href="ch21.html"><i class="fas fa-exclamation-circle"></i> 局限</a></li>
<li><a href="ch22.html"><i class="fas fa-toolbox"></i> 平台</a></li>
<li><a href="ch23.html"><i class="fas fa-history"></i> 简史</a></li>
<li><a href="ch24.html"><i class="fas fa-rocket"></i> 实战</a></li>
</ul>
<button class="ai-nav-toggle" id="navToggle" aria-label="切换导航">
<i class="fas fa-bars"></i>
</button>
</nav>
<!-- ==================== Hero Section ==================== -->
<section class="ai-hero">
<h1><i class="fas fa-brain"></i> AI 学习笔记</h1>
<p>附录E:在线运行环境</p>
<div class="ai-hero-badges">
<span class="ai-hero-badge"><i class="fas fa-book"></i> 系统学习</span>
<span class="ai-hero-badge"><i class="fas fa-code"></i> 实践导向</span>
</div>
</section>
<!-- ==================== 主内容区域 ==================== -->
<div class="content-wrapper">
<!-- ========== 主内容 ========== -->
<main class="main-content">
<nav class="ai-chapter-nav">
<div class="breadcrumb">
<a href="../../index.html"><i class="fas fa-home"></i> 首页</a>
<span class="separator">/</span>
<span class="current">附录E:在线运行环境</span>
</div>
<div class="chapter-nav-links">
<a href="appendix-d.html" class="prev-chapter"><i class="fas fa-arrow-left"></i> 上一章</a>
<span class="next-chapter disabled">下一章 <i class="fas fa-arrow-right"></i></span>
</div>
</nav>
<h2 id="appendix-e">附录E:在线运行环境</h2>
<p>以下Google Colab笔记本提供了各章节的实践练习环境,点击即可在浏览器中运行代码,无需本地配置。</p>
<div class="colab-grid">
<div class="colab-card">
<div class="colab-icon">🐍</div>
<h4>Python基础练习</h4>
<p>涵盖Python语法、数据结构、函数和面向对象编程的基础练习,适合初学者快速上手。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-python-basics" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🔢</div>
<h4>NumPy矩阵运算</h4>
<p>NumPy数组操作、矩阵乘法、广播机制、线性代数运算等核心概念的实践练习。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-numpy-operations" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">📉</div>
<h4>梯度下降可视化</h4>
<p>交互式可视化梯度下降算法,理解学习率、收敛过程和不同优化器的行为差异。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-gradient-descent" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🎯</div>
<h4>K-Means聚类</h4>
<p>实现K-Means算法,理解聚类原理、肘部法则和不同初始化策略对结果的影响。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-kmeans-clustering" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🖼️</div>
<h4>PyTorch CNN</h4>
<p>使用PyTorch构建卷积神经网络,在CIFAR-10数据集上进行图像分类训练。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-pytorch-cnn" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🔄</div>
<h4>Transformer Self-Attention</h4>
<p>从零实现Self-Attention机制,可视化注意力权重,理解Transformer的核心原理。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-transformer-attention" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">📝</div>
<h4>LLM文本生成</h4>
<p>使用Hugging Face Transformers加载预训练模型,进行文本生成和提示工程实验。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-llm-text-generation" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🔍</div>
<h4>LangChain RAG</h4>
<p>构建完整的RAG应用,包括文档加载、向量存储、检索和问答链的实现。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-langchain-rag" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🤖</div>
<h4>LangChain Agent</h4>
<p>创建能使用工具的AI Agent,实现ReAct推理循环,让模型自主完成复杂任务。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-langchain-agent" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
<div class="colab-card">
<div class="colab-icon">🧑💻</div>
<h4>个人AI助手项目</h4>
<p>综合运用所学知识,构建一个具备记忆、工具使用和知识库的个人AI助手。</p>
<a class="colab-badge" href="https://colab.research.google.com/drive/example-personal-ai-assistant" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab">
</a>
</div>
</div>
<script>
(function() {
'use strict';
const STORAGE_KEY = 'ai_notes_reading_progress';
const COMPLETED_KEY = 'ai_notes_completed_chapters';
// 获取所有章节标题
function getChapters() {
const chapters = [];
const headers = document.querySelectorAll('h2, h3');
headers.forEach((h, index) => {
if (!h.id) {
h.id = 'chapter-' + index;
}
chapters.push({
id: h.id,
element: h,
level: h.tagName.toLowerCase()
});
});
return chapters;
}
// 保存阅读位置
function saveProgress() {
const scrollY = window.scrollY || window.pageYOffset;
const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
const percent = maxScroll > 0 ? Math.round((scrollY / maxScroll) * 100) : 0;
const data = {
scrollY: scrollY,
percent: percent,
timestamp: Date.now()
};
localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
updateProgressBar(percent);
}
// 恢复阅读位置
function restoreProgress() {
try {
const data = JSON.parse(localStorage.getItem(STORAGE_KEY));
if (data && data.scrollY !== undefined) {
window.scrollTo(0, data.scrollY);
updateProgressBar(data.percent || 0);
}
} catch (e) {
console.log('No saved progress found');
}
}
// 更新进度条
function updateProgressBar(percent) {
const bar = document.getElementById('progressBar');
const text = document.getElementById('progressText');
if (bar) bar.style.width = percent + '%';
if (text) text.textContent = percent + '%';
}
// 获取已完成的章节
function getCompletedChapters() {
try {
return JSON.parse(localStorage.getItem(COMPLETED_KEY)) || [];
} catch (e) {
return [];
}
}
// 保存已完成章节
function saveCompletedChapters(completed) {
localStorage.setItem(COMPLETED_KEY, JSON.stringify(completed));
}
// 标记章节完成状态
function toggleChapterComplete(chapterId, btn) {
let completed = getCompletedChapters();
const index = completed.indexOf(chapterId);
if (index > -1) {
completed.splice(index, 1);
btn.classList.remove('completed');
btn.innerHTML = '✓ 标记完成';
} else {
completed.push(chapterId);
btn.classList.add('completed');
btn.innerHTML = '✓ 已完成';
}
saveCompletedChapters(completed);
updateChapterStyles();
updateTocHighlight();
}
// 更新章节样式
function updateChapterStyles() {
const completed = getCompletedChapters();
const chapters = getChapters();
chapters.forEach(ch => {
const section = ch.element.closest('.chapter') || ch.element.parentElement;
if (!section) return;
const badge = section.querySelector('.completion-badge');
if (completed.includes(ch.id)) {
section.classList.add('chapter-completed');
if (!badge) {
const newBadge = document.createElement('span');
newBadge.className = 'completion-badge';
newBadge.textContent = '已完成';
ch.element.appendChild(newBadge);
}
} else {
section.classList.remove('chapter-completed');
if (badge) badge.remove();
}
});
}
// 更新目录高亮
function updateTocHighlight() {
const completed = getCompletedChapters();
document.querySelectorAll('a[href^="#"]').forEach(link => {
const targetId = link.getAttribute('href').slice(1);
if (completed.includes(targetId)) {
link.classList.add('toc-completed');
} else {
link.classList.remove('toc-completed');
}
});
}
// 添加标记完成按钮
function addCompleteButtons() {
const chapters = getChapters();
chapters.forEach(ch => {
const section = ch.element.closest('.chapter') || ch.element.parentElement;
if (!section || section.querySelector('.mark-complete-btn')) return;
const btn = document.createElement('button');
btn.className = 'mark-complete-btn';
btn.innerHTML = '✓ 标记完成';
btn.setAttribute('data-chapter', ch.id);
btn.addEventListener('click', function(e) {
e.preventDefault();
toggleChapterComplete(ch.id, this);
});
// 插入到标题后面
ch.element.insertAdjacentElement('afterend', btn);
});
// 恢复按钮状态
const completed = getCompletedChapters();
document.querySelectorAll('.mark-complete-btn').forEach(btn => {
const chId = btn.getAttribute('data-chapter');
if (completed.includes(chId)) {
btn.classList.add('completed');
btn.innerHTML = '✓ 已完成';
}
});
}
// 节流函数
function throttle(func, limit) {
let inThrottle;
return function() {
const args = arguments;
const context = this;
if (!inThrottle) {
func.apply(context, args);
inThrottle = true;
setTimeout(() => inThrottle = false, limit);
}
}
}
// 初始化
function init() {
// 为章节容器添加class
document.querySelectorAll('h2, h3').forEach(h => {
const parent = h.parentElement;
if (parent && !parent.classList.contains('chapter')) {
parent.classList.add('chapter');
}
});
addCompleteButtons();
updateChapterStyles();
updateTocHighlight();
// 恢复进度
restoreProgress();
// 监听滚动,节流保存
window.addEventListener('scroll', throttle(saveProgress, 1000));
// 页面加载完成后再次恢复(处理异步加载内容)
window.addEventListener('load', restoreProgress);
}
// DOM就绪后初始化
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>
<!-- ============================================================ -->
<!-- 附录E:在线运行环境 -->
<!-- ============================================================ -->
<!-- ============================================================ -->
</main>
</div>
<!-- 页脚 -->
<!-- ============================================================ -->
<footer class="footer">
<div class="footer-content">
<div class="footer-section">
<h3><i class="fas fa-graduation-cap"></i> AI学习笔记</h3>
<p>从零开始系统学习人工智能</p>
<p>涵盖前置基础、核心原理、工程实践、应用工具、进阶展望</p>
</div>
<div class="footer-section">
<h3><i class="fas fa-bookmark"></i> 内容导航</h3>
<p>第1-11章:基础与核心(见 ai-notes-core.html)</p>
<p>第12-23章:工程实践与进阶(本文件)</p>
<p>附录A:GPU与算力指南</p>
<p>附录B:术语表</p>
</div>
<div class="footer-section">
<h3><i class="fas fa-info-circle"></i> 说明</h3>
<p>本笔记仅供学习参考,内容如有错误欢迎指正。</p>
<p>AI技术发展迅速,部分信息可能随时间变化。</p>
</div>
</div>
<div class="footer-bottom">
<p>AI学习笔记 © 2024 | 持续更新中</p>
</div>
</footer>
</div><!-- /ai-notes-container -->
<!-- Scripts -->
<script src="../../js/mobile-menu.js"></script>
<script src="../../js/dark-mode.js"></script>
<script>
// 目录滚动高亮
(function() {
const tocLinks = document.querySelectorAll('.toc-sidebar a');
const sections = [];
tocLinks.forEach(link => {
const id = link.getAttribute('href');
if (id && id.startsWith('#')) {
const el = document.querySelector(id);
if (el) sections.push({ link, el });
}
});
function updateActive() {
const scrollY = window.scrollY + 100;
let current = sections[0];
for (const s of sections) {
if (s.el.offsetTop <= scrollY) current = s;
}
tocLinks.forEach(l => l.classList.remove('active'));
if (current) current.link.classList.add('active');
}
window.addEventListener('scroll', updateActive);
updateActive();
})();
</script>
</body>
</html>