Compare commits

..

33 Commits

Author SHA1 Message Date
pengxiao 18d0f3700a Merge branch 'main' of http://100.123.97.90:3000/pengxiao/2026_DesignAI 2026-06-14 11:31:32 +08:00
pengxiao c85bbd3c55 docs: 调整附录与第二章排版,补充模块/包说明
- AGENTS.md: 新增 Codex 代理说明文件
- .gitignore: 屏蔽第三方工具目录 (.prism/, .claudeprism/, .agents/)
- preamble: 启用 xcolor dvipsnames 选项,新增 GREEN 颜色与 \greenheading 命令
- ch02-framework: 修正智能体段落引号格式
- ap01-programming: 补充 Python 模块与包的对比说明(esp_engine 示例)
- ap02-vibe-coding: 应用 \greenheading 标题样式,强调 commit 作为审核检查点
- 移除 2026_DesignAI.code-workspace(放弃 workspace 持久化方案)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 11:31:25 +08:00
pengxiao 979b5128dc docs(appendix): 重写 Vibe Coding 章节,补充 EPCC 工作流与工具分类体系 2026-06-04 14:01:52 +08:00
pengxiao 58a85162a6 v0.1-初步版本,开始逐点修改 2026-06-04 10:48:42 +08:00
pengxiao 55583968d9 sync from overleaf 2026-05-30 02:34:49 +08:00
pengxiao 90ea912298 Update on Overleaf. 2026-05-29 18:34:49 +00:00
pengxiao 73d56693cf sync from overleaf 2026-05-30 02:32:28 +08:00
pengxiao b8aee456b2 sync from overleaf 2026-05-30 02:32:28 +08:00
pengxiao 60ebdb7077 Update on Overleaf. 2026-05-29 18:31:02 +00:00
pengxiao a4c26f0e08 update to overleaf 2026-05-30 02:30 2026-05-30 02:30:58 +08:00
pengxiao a1b7ae7712 update to overleaf 2026-05-30 02:30 2026-05-30 02:30:58 +08:00
pengxiao 1f21ff9c8a Split 'officefile/latex/' into commit 'f2715cbac161dea61b606a7c1959923bdd52c904'
git-subtree-dir: officefile/latex
git-subtree-mainline: 5a552cb41c
git-subtree-split: f2715cbac1
2026-05-30 02:10:01 +08:00
pengxiao f2715cbac1 merge: resolve overleaf initial conflict 2026-05-30 02:09:03 +08:00
pengxiao 5a552cb41c merge: resolve overleaf initial conflict 2026-05-30 02:09:03 +08:00
pengxiao 6e4472954e Update on Overleaf. 2026-05-29 18:08:14 +00:00
pengxiao 2997b460be init: merge overleaf subtree baseline 2026-05-30 02:06:00 +08:00
pengxiao ec70447106 init: merge overleaf subtree baseline 2026-05-30 02:06:00 +08:00
pengxiao 5eff99a876 Update on Overleaf. 2026-05-29 18:05:59 +00:00
pengxiao d489c968e3 update to overleaf 2026-05-30 02:01 2026-05-30 02:01:48 +08:00
pengxiao 2dd5138da3 update to overleaf 2026-05-30 02:01 2026-05-30 02:01:48 +08:00
pengxiao 0c2c19945e 更新 README.md 2026-05-29 21:36:20 +08:00
pengxiao 2305ae0ba6 docs: 新增项目 README,清理残留 label,添加 diagbox 宏包
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 21:24:00 +08:00
pengxiao b38aa2b9e0 docs: 新增项目 README,清理残留 label,添加 diagbox 宏包
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 21:24:00 +08:00
pengxiao 3ff9107c32 Revert "test: verify push connectivity"
This reverts commit 38a761b071.
2026-05-29 20:29:31 +08:00
pengxiao 38a761b071 test: verify push connectivity 2026-05-29 20:29:15 +08:00
pengxiao 99a65f025c 测试gitea 2026-05-29 18:07:06 +08:00
pengxiao 89c038b1c4 feat(latex): 配置 natbib 参考文献系统并插入引用
- 新增 DesignAI.bib(Garrity + 普尔等 2 条)
- preamble 添加 natbib + plainnat 样式
- ch01/ch02 插入 \cite 引用(共 5 处)
- 参考文献加入目录 outline(\addcontentsline)
- 删除 ap07-references.tex,由 \bibliography 自动生成

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 15:40:52 +08:00
pengxiao c55f956656 sync(latex): 从 Word 同步第二章和附录内容
- ch02: 第5节重写为"环境-智能体框架",新增表2.1/2.2和图2.1
- ch01: 补充 Garrity 引用来源
- 全部附录(ap01-ap09)从 Word 重新转换,修复 \sub 等转换错误
- 新增 ch13 结语占位、上下篇分隔页

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 15:13:27 +08:00
pengxiao 491ba89892 refactor(officefile): 按 md/latex/word 三层结构重组文档目录
将 Markdown 源文件移入 md/,LaTeX 工作目录保留在 latex/,
Word 导出移入 word/;删除临时脚本、调试截图和空 stub。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:25:21 +08:00
pengxiao fa7d851bac fix(latex): 修复中文引号遗漏,补丁 ``...'' → "..."(15处)
上次修复了 ''...'' 模式,遗漏了 ``...'' 包裹中文的情况。
补充修复 ch02-ch08 及 ap01-ap02 中的混合引号。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:10:44 +08:00
pengxiao c9d2ce8a69 fix(latex): 修复中文引号渲染,''...'' → "..."(139处)
pandoc 转换将中文双引号变为两个ASCII单引号,导致LaTeX中
左右引号均渲染为右引号。替换为Unicode中文引号以正确显示。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 14:05:08 +08:00
pengxiao acfcca58f5 chore(latex): 清理临时文件,figures 加入 gitignore
删除 content_raw.tex、_test_ch04.tex、_check_jumps.py、_check_nums.py
将 officefile/latex/figures/ 加入 .gitignore

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 12:25:04 +08:00
pengxiao d4665a362e feat(latex): 新增 LaTeX 排版系统,从 Markdown 生成 ctexbook
- 新增 officefile/latex/ 目录,包含 main.tex、preamble.tex 及 14 个章节 + 10 个附录 tex 文件
- md→tex 转换流程:pandoc 转换 + _postprocess.py 后处理(去编号、修破折号、清标签)
- 修复 5 个 md 源文件的标题层级(H1→H2 降级,统一层级结构)
- 配置 VS Code LaTeX Workshop(xelatex + ctexbook 编译链)
- 新增 VS Code workspace 和 .gitignore(排除 LaTeX 编译产物)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 12:21:15 +08:00
13 changed files with 375 additions and 135 deletions
+5 -1
View File
@@ -31,4 +31,8 @@ output/
*.blg *.blg
*.synctex.gz *.synctex.gz
*.pdf *.pdf
officefile/latex/figures/
# 第三方软件
.prism/
.claudeprism/
.agents/
-11
View File
@@ -1,11 +0,0 @@
{
"folders": [
{
"path": "."
},
{
"path": "../2026_WritingAgent"
}
],
"settings": {}
}
+119
View File
@@ -0,0 +1,119 @@
# AGENTS.md
This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.
## Project Overview
This is **设计人工智能:基础与应用** — a textbook project for design AI education. The book covers AI fundamentals (principles, perception, generation, agents) and their applications across design domains (digital media, industrial design, environmental design, urban planning).
A supplementary volume, **CC4SI (Codex for Spatial Intelligence)**, is preserved in `officefile/supplements/` and focuses on spatial intelligence and autonomous design using Codex.
**Key Characteristics:**
- Educational content organized as a book with 12 chapters + 9 appendices
- Mixed Chinese/English documentation and code
- Git-based workflow with Obsidian integration for content editing
- Pandoc-based export to Word (DOCX) with publisher template
- Standard research project directory structure
## Directory Structure
```
2026_DesignAI/
├── data/ # Data and resources
│ ├── pics/ # Book illustrations
│ └── references/ # Bibliography data
├── dofile/ # Code and scripts
│ └── examples/ # Python code examples
│ ├── 00-introduction/ # Setup first assistant
│ ├── 01-foundations/ # State machines, modularity, etc.
│ └── 02-spatial-intelligence/ # Spatial analysis examples
├── officefile/ # Main book content
│ ├── 00-frontmatter/ # 自序 (Preface), 目录 (TOC)
│ ├── 01-introduction/ # Ch1: AI development history
│ ├── 02-framework/ # Ch2: AI theoretical framework
│ ├── 03-1d-sequence/ # Ch3: Sequence & text (RNN→LLM)
│ ├── 04-2d-vision/ # Ch4: Images & vision (CNN)
│ ├── 05-3d-spatial/ # Ch5: Spatial & 3D (PointNet)
│ ├── 06-reinforcement/ # Ch6: Reinforcement learning
│ ├── 07-generative-ai/ # Ch7: Generative AI (Diffusion)
│ ├── 08-agent/ # Ch8: AI Agent
│ ├── 09-digital-media/ # Ch9: Digital media design
│ ├── 10-industrial-design/ # Ch10: Industrial design
│ ├── 11-environmental-landscape/ # Ch11: Environmental & landscape
│ ├── 12-urban-ecology/ # Ch12: Urban & ecological planning
│ ├── appendix/ # Appendices 1-9
│ └── supplements/ # CC4SI supplementary material
│ ├── 00-05/ # Spatial intelligence chapters
│ └── appendix/ # Academic writing workflow
├── output/ # Generated outputs
│ └── docx/ # Word exports
├── Archive/ # Archived original directories
├── .Codex/skills/markdown-to-docx/ # DOCX conversion skill
├── .pandoc/ # Pandoc config (CSL, Zotero JSON)
└── .obsidian/ # Obsidian vault configuration
```
## Book Structure
### Upper Volume: Principles & Technology
| Chapter | Topic | Lines | Status |
|---------|-------|-------|--------|
| 01 | AI development history & paradigm evolution | 367 | Complete |
| 02 | Theoretical framework (functional perspective, MLP) | 897 | Complete |
| 03 | 1D data: Sequence & text (RNN → LLM) | 1595 | Complete |
| 04 | 2D data: Images & vision (CNN → ViT) | 867 | Complete |
| 05 | 3D data: Spatial & 3D (PointNet → Spatial AI) | 1421 | Complete |
| 06 | Generative AI (VAE/GAN → Diffusion) | 496 | Complete |
| 07 | AI Agent (rules → LLM Agent) | 581 | Complete |
| 08 | Reinforcement learning (Q-Learning → RLHF) | 896 | Complete |
### Lower Volume: Design Applications
| Chapter | Topic | Lines | Status |
|---------|-------|-------|--------|
| 09 | Digital media design | 161 | Thin |
| 10 | Industrial & product design | 145 | Thin |
| 11 | Environmental & landscape design | 153 | Thin |
| 12 | Urban & ecological planning | 317 | Moderate |
### Appendices
9 appendices covering programming basics, Vibe Coding, academic writing, web tools, references, glossary, and tips.
## Working with This Repository
### For Content Editing
- Edit `.md` files in `officefile/` — they are the book source
- Use Obsidian for rich editing (vault at project root)
- Git commits follow conventional format: `docs(ch01): description`
### For DOCX Export
- Use the `markdown-to-docx` skill in `.Codex/skills/`
- Publisher template: `machinery-industry-press-writing-template.dotx`
- Output goes to `output/docx/`
### For Python Examples
- Examples in `dofile/examples/` are self-contained
- Run directly: `python dofile/examples/01-foundations/state_machine.py`
- No global test suite — verify examples individually
## Language Considerations
- **Documentation**: Primarily Chinese with English technical terms
- **Code**: Variable names and comments in English
- **File names**: Mix of Chinese and English — use proper encoding
## Commit Convention
```
<type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, chore
Scopes: ch01-ch12, appendix, supplements, examples
Examples:
- docs(ch03): 补充 Transformer 注意力机制详解
- feat(examples): 新增空间推理示例
- fix(ch05): 修正 PointNet 结构描述
```
+72
View File
@@ -0,0 +1,72 @@
# 设计人工智能:基础与应用
> Design AI: Fundamentals and Applications
**作者**:彭晓
**版本**v1.02026年5月)
## 简介
本书面向设计专业学生、研究者和从业者,系统讲解人工智能的核心技术原理,并展示 AI 在五大设计领域的应用实践。内容覆盖从神经网络基础到大模型、从生成式 AI 到智能体的完整知识体系。
## 目录结构
```
2026_DesignAI/
├── data/ # 数据与资源
│ ├── pics/ # 书籍插图
│ └── references/ # 参考文献数据
├── dofile/ # 代码与脚本
│ └── examples/ # Python 代码示例
├── officefile/ # 文档内容
│ ├── md/ # Markdown 源文件(各章节、附录)
│ ├── latex/ # LaTeX 排版系统(编译入口)
│ └── word/ # Word 导出
└── output/ # 生成输出
```
## 全书结构
### 上篇:原理与技术
| 章节 | 主题 | 内容 |
|------|------|------|
| 第1章 | AI发展历程 | 从符号主义到大模型的范式演进 |
| 第2章 | 理论框架 | 函数式视角、数据模态、MLP、环境-智能体框架 |
| 第3章 | 序列与文本 | RNN → LSTM → Transformer → 大语言模型 |
| 第4章 | 图像与视觉 | CNN → ResNet → ViT → SAM |
| 第5章 | 空间与三维 | PointNet → 空间 AI |
| 第6章 | 生成式AI | VAE/GAN → 扩散模型 → DALL·E/Sora |
| 第7章 | AI Agent | 规则系统 → LLM Agent |
| 第8章 | 强化学习 | Q-Learning → RLHF |
### 下篇:设计领域应用
| 章节 | 主题 |
|------|------|
| 第9章 | 数字媒体艺术 |
| 第10章 | 工业与产品设计 |
| 第11章 | 环境与景观设计 |
| 第12章 | 城市与生态规划设计 |
### 附录
9 个附录,涵盖编程基础、Vibe Coding、学术写作、网络工具、学习资源、关键术语表等。
## LaTeX 编译
使用 XeLaTeX + natbib 编译:
```bash
cd officefile/latex
xelatex main.tex
bibtex main
xelatex main.tex
xelatex main.tex
```
需要 TeX Live 2026,中文字体使用 ctex 宏包。
## 许可
版权所有,未经授权不得转载。
+1
View File
@@ -3,6 +3,7 @@
本目录包含书中提到的所有可运行代码示例,按章节组织。 本目录包含书中提到的所有可运行代码示例,按章节组织。
## 目录结构 ## 目录结构
## 测试
``` ```
examples/ examples/
+39 -9
View File
@@ -1,20 +1,50 @@
@book{EJUUCH39, @book{EJUUCH39,
title = {All the Math You Missed: But Need to Know for Graduate School}, title = {All the Math You Missed 2nd Edition},
author = {Thomas A. Garrity}, author = {{Thomas A. Garrity}},
edition = {2}, edition = {2},
year = {2017}, url = {https://www.cambridge.org/universitypress/subjects/mathematics/recreational-mathematics/all-math-you-missed-need-know-graduate-school-2nd-edition},
publisher = {Cambridge University Press}, urldate = {2026-05-29},
langid = {english} langid = {gb},
file = {F\:\\Zotero\\storage\\QZZ9ML74\\thomas-a.-garrity-all-the-math-you-missed-2nd-ed.pdf;F\:\\Zotero\\storage\\85NY3EYQ\\all-math-you-missed-need-know-graduate-school-2nd-edition.html}
} }
@book{MGDW8DPN, @book{MGDW8DPN,
title = {人工智能:计算agent基础}, title = {人工智能:计算agent基础},
author = {David L. Poole and Alan K. Mackworth}, author = {{普尔} and {麦克沃思}},
translator = {董红斌 and 董兴业 and 童向荣 and 汪廷华}, translator = {{董红斌} and {董兴业} and {童向荣} and {汪廷华}},
year = {2015}, namea = {{David L.Poole} and {Alan K.Mackworth}},
nameatype = {collaborator},
date = {2015-01-01},
series = {计算机科学丛书}, series = {计算机科学丛书},
publisher = {机械工业出版社}, publisher = {机械工业出版社},
url = {https://book.douban.com/subject/26319332/},
urldate = {2026-05-26},
abstract = {《人工智能:计算agent基础》讨论AI科学,它将AI作为智能计算Agent设计的研究课题。《人工智能:计算agent基础》虽然设计为教科书,但它也适合广大专业人员和研究人员阅读。《人工智能:计算agent基础》的一个重要特色是其在线学习资源。在过去的几十年里,人工智能是作为一种严肃科学和工程学科出现的。《人工智能:计算agent基础》提供了针对本科生和研究生的第一手便利可用的领域综合资料,对当今该领域的基础发展进行了展望。像任何名副其实的科学一样,AI具有条理分明、形式化的理论和难以控制的实验。《人工智能:计算agent基础》均衡了理论和实验部分,并说明了如何将理论与实验密切地联系起来,使科学与工程应用共同发展。},
isbn = {978-7-111-48457-8}, isbn = {978-7-111-48457-8},
langid = {chinese}, langid = {chinese},
origtitle = {Artificial Intelligence: Foundations of Computational Agents} origtitle = {Artificial Intelligence Foundations of Computational Agents},
pagetotal = {452},
annotation = {price: 79.00\\
comments: 3\\
creatorsExt: [\{"firstName":"","lastName":"普尔","creatorType":"author","fieldMode":1,"country":"加","original":"David L.Poole"\},\{"firstName":"","lastName":"麦克沃思","creatorType":"author","fieldMode":1,"country":"加","original":"Alan K.Mackworth"\},\{"firstName":"","lastName":"董红斌","creatorType":"translator","fieldMode":1,"country":"","original":""\},\{"firstName":"","lastName":"董兴业","creatorType":"translator","fieldMode":1,"country":"","original":""\},\{"firstName":"","lastName":"童向荣","creatorType":"translator","fieldMode":1,"country":"","original":""\},\{"firstName":"","lastName":"汪廷华","creatorType":"translator","fieldMode":1,"country":"","original":""\}]}
}
@book{RP2EHXXB,
title = {UNIX编程艺术},
author = {Raymond, Eric S.},
translator = {{姜宏} and {何源} and {蔡晓俊}},
date = {2011-01},
series = {博文视点·传世经典书丛},
publisher = {电子工业出版社},
url = {https://book.douban.com/subject/5387401/},
urldate = {2026-06-04},
abstract = {本书主要介绍了Unix系统领域中的设计和开发哲学、思想文化体系、原则与经验,由公认的Unix编程大师、开源运动领袖人物之一Eric S. Raymond倾力多年写作而成。包括Unix设计者在内的多位领域专家也为本书贡献了宝贵的内容。本书内容涉及社群文化、软件开发设计与实现,覆盖面广、内容深邃,完全展现了作者极其深厚的经验积累和领域智慧。},
isbn = {978-7-121-12329-0},
langid = {chinese},
origtitle = {The Art of UNIX Programming},
pagetotal = {530},
annotation = {price: 69.00元\\
rating: 8.8\\
ratingPeople: 334人评价\\
comments: 117}
} }
@@ -494,6 +494,47 @@ train\_model(100, optimizer="SGD", lr=0.1)
导入模块 导入模块
Python 通过\textbf{模块}module)和\textbf{}package)组织代码复用:一个 \texttt{.py} 文件就是一个模块,含有 \texttt{\_\_init\_\_.py} 的文件夹就是一个包,使用 \texttt{from 包.包.模块 import 函数/类} 的语法导入。
以本书生态安全格局项目中的 \texttt{esp\_engine/} 为例:
\begin{verbatim}
esp_engine/
├── data_manager.py ← 模块(1个文件,7个函数)
├── io/ ← 包(文件夹,2个模块)
│ ├── __init__.py
│ ├── raster_io.py ← 7个函数
│ └── vector_io.py ← 5个函数
├── steps/ ← 包(文件夹,10个模块)
│ ├── __init__.py
│ ├── reclassify.py
│ ├── cost_distance.py
│ └── ...8个文件)
└── workflows/ ← 包(文件夹,6个模块)
├── __init__.py
├── suitability.py
└── ...5个文件)
\end{verbatim}
何时用模块、何时用包?原则很简单——看体量(表\ref{tab:module-vs-package})。
\begin{table}[htbp]
\centering
\caption{模块与包的选择原则}
\label{tab:module-vs-package}
\begin{tabular}{@{} l l l @{}}
\toprule
\textbf{情况} & \textbf{做法} & \textbf{项目中的例子} \\
\midrule
功能集中,一个文件装得下 & 模块(单个 .py & data\_manager.py:7个函数全是数据预处理 \\[3pt]
功能分多个领域,各有独立逻辑 & 包(文件夹+子模块) & steps/:10个文件,每个是一种 GIS 操作 \\[3pt]
拿捏不准 & 先做模块,膨胀了再拆 &\\
\bottomrule
\end{tabular}
\end{table}
一句话:\textbf{模块是``够用就好的最小单位'',包是``需要分家时的组织方式''}
\emph{\# 导入标准库} \emph{\# 导入标准库}
\textbf{import} os \textbf{import} os
@@ -696,7 +737,7 @@ Agent开发 & LangGraph & pip install langgraph & 状态机式Agent开发 \\
\subsubsection{模型资源} \subsubsection{模型资源}
\paragraph{\texorpdfstring{Hugging \paragraph{\texorpdfstring{Hugging
Face\href{https://huggingface.co/}{huggingface.co}}{Hugging Facehuggingface.co}}\label{hugging-facehuggingface.co} Face\href{https://huggingface.co/}{huggingface.co}}{Hugging Facehuggingface.co}}
功能:模型仓库、数据集、Spaces在线演示 功能:模型仓库、数据集、Spaces在线演示
@@ -788,7 +829,7 @@ train\_test\_split
\textbf{from} sklearn.metrics \textbf{import} accuracy\_score, \textbf{from} sklearn.metrics \textbf{import} accuracy\_score,
classification\_report classification\_report
\subsubsection{}\label{section}
\emph{\# 1. 加载数据} \emph{\# 1. 加载数据}
@@ -915,7 +956,7 @@ print(f"dy/dx = \{x.grad\}") \emph{\# 应为 2x + 3 = 7x=2时)}
\textbf{from} torchvision \textbf{import} datasets, transforms \textbf{from} torchvision \textbf{import} datasets, transforms
\paragraph{}\label{section-4}
\emph{\# 1. 数据准备} \emph{\# 1. 数据准备}
@@ -5,108 +5,81 @@ Code、Markdown/Obsidian、Git/GitHub等核心工具的使用方法。
\section{Vibe Coding的概念与工具} \section{Vibe Coding的概念与工具}
\subsubsection{什么是Vibe Coding} \subsection{\greenheading{什么是Vibe Coding}}
传统编程\textbf{明确需求 → 设计算法 → 编写代码} 传统编程遵循``明确需求 → 设计算法 → 编写代码''的线性流程,而 Vibe Coding 则转变为``\textbf{模糊想法 → AI辅助 → 迭代完善}''。这是一种以AI为核心的编程新模式:开发者用自然语言描述意图,AI生成代码,再通过迭代对话逐步完善。对于编程经验较少的设计专业读者而言,这种模式大幅降低了技术门槛——不需要记住语法细节,只需要清楚地表达”想要什么”。
Vibe Coding\textbf{模糊想法 → AI辅助 → 迭代完善} 然而,编程技术门槛的降低并不意味着对原理理解的放松。《Unix编程艺术》\cite{RP2EHXXB}中提出了一条经典原则——``机制,而非策略''Mechanism, not policy):好的系统应当提供稳定、通用的底层能力(机制),而将具体的使用方式和决策(策略)交给使用者。在 Vibe Coding 中,这一关系发生了有趣的反转:AI 承担的恰恰是``策略''的角色——它根据开发者的意图,自主选择实现方案、生成具体代码、决定技术路线;而开发者则必须掌握``机制''——理解算法原理、架构模式和调试方法——才能判断 AI 的策略是否正确。这意味着,Vibe Coding 对开发者的要求从``会写代码''转向了``会判断代码'':你需要理解架构原理才能审查AI的方案,需要掌握调试方法才能发现AI的错误,需要对领域知识有足够认知才能提出正确的问题。换言之,\textbf{AI 降低了编程的执行门槛,却提高了对思维门槛的要求}
Vibe \subsection{工作流程}
Coding是一种以AI为核心的编程新模式:开发者用自然语言描述意图,AI生成代码,再通过迭代对话逐步完善。对于编程经验较少的设计专业读者而言,这种模式大幅降低了技术门槛——不需要记住语法细节,只需要清楚地表达“想要什么”。
\subsubsection{工作流程} Vibe Coding 的基本流程是:\textbf{描述意图}→AI生成代码→运行测试→迭代优化→理解学习。例如,先让AI"创建一个图像分类模型",运行后发现问题,再逐步调整——"把隐藏层改成128个神经元"——最终阅读并理解AI生成的代码。简单任务可直接通过对话完成;面对较复杂的项目,推荐采用更结构化的四阶段工作流——\textbf{Explore-Plan-Code-Commit}EPCC,表\ref{tab:epcc}),将 Vibe Coding 从"随意迭代"提升为"有章法的 AI 协作"。
\begin{table}[htbp]
\centering
\caption{Explore-Plan-Code-Commit 工作流四阶段}
\label{tab:epcc}
\begin{tabular}{@{} l l p{3.5cm} p{5.5cm} @{}}
\toprule
\textbf{阶段} & \textbf{英文} & \textbf{目的} & \textbf{典型操作} \\
\midrule
探索 & Explore & 理解项目全貌,避免脱离实际 & 通读现有代码、搜索相关文件、理解架构与已有模式 \\[3pt]
规划 & Plan & 先想清楚再动手,确保方向正确 & 让 AI 生成实施方案,审查确认后再编码 \\[3pt]
编码 & Code & 按计划逐步实现 & 分步实现功能、逐步验证、遇到问题回退调整 \\[3pt]
提交 & Commit & 阶段性成果存档,保留历史轨迹 & 及时 git commit,附上有意义的说明 \\
\bottomrule
\end{tabular}
\end{table}
\textbf{示例场景}:为景观设计项目创建一个植物配置推荐工具。
\begin{enumerate} \begin{enumerate}
\def\labelenumi{\arabic{enumi}.} \def\labelenumi{\arabic{enumi}.}
\tightlist
\item \item
\textbf{描述意图}:用自然语言说明需求 \textbf{Explore}:让 AI 先通读项目中的植物数据库、现有推荐逻辑和用户反馈文件,理解上下文
\item
\textbf{Plan}:请求 AI 制定方案——``先分析需求,列出要实现的模块,我确认后再开始写代码''
\item
\textbf{Code}:按方案逐模块实现,每完成一个模块就运行验证
\item
\textbf{Commit}:每个功能模块完成后提交一次,如 ``feat: 添加按气候区域筛选植物的功能''
\end{enumerate} \end{enumerate}
``帮我创建一个简单的图像分类模型'' EPCC 的核心理念是\textbf{先理解、再规划、后动手、常存档}——这与传统的"边写边想"形成对比,特别适合设计专业读者在 AI 辅助下管理复杂项目。
\begin{enumerate} 值得强调的是,Commit 阶段并非简单的``保存'',而是\textbf{人工审核的检查点}。每一次 commit 都意味着开发者已经阅读、理解并确认了 AI 生成的代码——只有审核无误的内容才应当提交。因此,在 Vibe Coding 中不宜一次性让 AI 生成大量代码,而应将任务拆分为小步骤,每一步都以一次成功的 commit 为目标。从这个意义上说,Vibe Coding 的过程就是\textbf{不断 commit 的过程}:生成一小段代码 → 审核确认 → commit → 进入下一轮。这种``小步快跑''的节奏既保证了代码质量,也帮助开发者在每次 commit 中逐步积累对项目的理解。
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{1}
\item
\textbf{AI生成代码}:自动生成完整代码框架
\item
\textbf{运行测试}:发现问题或需要调整
\item
\textbf{迭代优化}:通过对话逐步改进
\end{enumerate}
``把隐藏层改成128个神经元'' \subsection{工具生态}
\begin{enumerate} 当前 AI 编程工具已形成多种产品形态,各有侧重(表\ref{tab:ai-tools})。
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{4}
\tightlist
\item
\textbf{理解学习}:阅读AI生成的代码,理解实现原理
\end{enumerate}
\subsubsection{实践技巧} \begin{table}[htbp]
\centering
\caption{AI 编程工具的分类与代表产品}
\label{tab:ai-tools}
\begin{tabular}{@{} l l p{3.2cm} p{4.5cm} @{}}
\toprule
\textbf{类别} & \textbf{代表工具} & \textbf{特点} & \textbf{适用场景} \\
\midrule
网页对话 & ChatGPT、Claude.ai & 代码生成与解释,零配置 & 学习咨询、快速原型 \\[3pt]
编辑器插件 & GitHub Copilot、Cline & 实时补全与对话,融入现有 IDE & 日常开发 \\[3pt]
AI 原生 IDE & Cursor、Windsurf & 对话式编程,深度集成项目理解 & 快速原型、中型项目 \\[3pt]
终端智能体 & Claude Code、Codex CLI & CLI 操作,多文件协作,架构级推理 & 项目级开发、大型重构 \\[3pt]
云端自主智能体 & OpenAI Codex、Devin & 云端沙箱全自动执行 & 重复性任务、CI/CD 集成 \\
\bottomrule
\end{tabular}
\end{table}
{\def\LTcaptype{none} % do not increment counter 初学者可从``网页对话''入手,逐步过渡到``编辑器插件''和``AI 原生 IDE''。对于需要深度掌控项目结构的中大型工作,``终端智能体''提供了最强的控制力和推理深度。``云端自主智能体''正在快速发展,能够独立完成从需求到部署的全流程,但在可控性和代码质量方面仍有提升空间。选择工具时,核心考量因素包括:上下文理解能力(能否理解整个项目而非单文件)、代码质量与幻觉控制(生成结果是否可靠)、以及成本效率(每次交互的 token 消耗)。
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.1528}}
>{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.4583}}@{}}
\toprule\noalign{}
\begin{minipage}[b]{\linewidth}\raggedright
技巧
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
说明
\end{minipage} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
明确需求 & 详细描述输入输出,提供上下文 \\
分步实现 & 复杂功能拆解为小任务,逐步完成 \\
验证结果 & 运行并检查AI生成的代码是否正确 \\
学习思考 & 不盲目接受,理解AI为什么这样写 \\
\end{longtable}
}
\subsubsection{工具生态}
{\def\LTcaptype{none} % do not increment counter
\begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\linewidth - 6\tabcolsep) * \real{0.2375}}
>{\raggedright\arraybackslash}p{(\linewidth - 6\tabcolsep) * \real{0.1625}}
>{\raggedright\arraybackslash}p{(\linewidth - 6\tabcolsep) * \real{0.3125}}
>{\raggedright\arraybackslash}p{(\linewidth - 6\tabcolsep) * \real{0.2625}}@{}}
\toprule\noalign{}
\begin{minipage}[b]{\linewidth}\raggedright
工具
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
形态
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
特点
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
适用场景
\end{minipage} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
ChatGPT / Claude & 网页对话 & 代码生成与解释 & 学习咨询、快速原型 \\
GitHub Copilot & 编辑器插件 & 实时代码补全 & 日常开发 \\
Cursor & AI原生IDE & 对话式编程 & 快速原型、中型项目 \\
Claude Code & 终端CLI & 终端AI编程、多文件协作 & 项目级开发 \\
Replit Agent & 在线平台 & 端到端开发 & 小型项目、学习实验 \\
\end{longtable}
}
\section{Claude Code简介与使用} \section{Claude Code简介与使用}
\subsubsection{什么是Claude Code} \subsection{什么是Claude Code}
Claude Claude
Code是Anthropic推出的命令行AI编程工具(CLI),能够直接在终端中理解项目上下文、读写文件、执行命令,实现端到端的AI辅助开发。它也提供VSCode扩展,可以在编辑器中无缝使用。 Code是Anthropic推出的命令行AI编程工具(CLI),能够直接在终端中理解项目上下文、读写文件、执行命令,实现端到端的AI辅助开发。它也提供VSCode扩展,可以在编辑器中无缝使用。
\subsubsection{安装与配置} \subsection{安装与配置}
\emph{\# 安装(需要 Node.js 18+}\\ \emph{\# 安装(需要 Node.js 18+}\\
npm install -g @anthropic-ai/claude-code\\ npm install -g @anthropic-ai/claude-code\\
@@ -117,7 +90,7 @@ claude
启动后进入交互式对话界面,直接用自然语言描述需求即可。 启动后进入交互式对话界面,直接用自然语言描述需求即可。
\subsubsection{核心使用方式} \subsection{核心使用方式}
\textbf{对话式开发}:用自然语言描述任务,Claude \textbf{对话式开发}:用自然语言描述任务,Claude
Code会自动读取相关文件、编写代码、执行测试。 Code会自动读取相关文件、编写代码、执行测试。
@@ -131,7 +104,7 @@ Code可以直接读取、创建和编辑项目中的文件,每次修改前会
\textbf{命令执行}:可以请求Claude \textbf{命令执行}:可以请求Claude
Code运行终端命令,如安装依赖、运行脚本等。 Code运行终端命令,如安装依赖、运行脚本等。
\subsubsection{VSCode中的Claude \subsection{VSCode中的Claude
Code} Code}
Claude Code提供VSCode扩展,在编辑器中获得同样的AI辅助能力: Claude Code提供VSCode扩展,在编辑器中获得同样的AI辅助能力:
@@ -151,7 +124,7 @@ Claude Code提供VSCode扩展,在编辑器中获得同样的AI辅助能力:
\textbf{常用场景}: - 选中一段代码,请求”解释这段代码“ - \textbf{常用场景}: - 选中一段代码,请求”解释这段代码“ -
选中函数,请求”添加错误处理” - 在Claude面板中输入”帮我写单元测试” 选中函数,请求”添加错误处理” - 在Claude面板中输入”帮我写单元测试”
\subsubsection{典型项目工作流} \subsection{典型项目工作流}
\textbf{推荐项目结构} \textbf{推荐项目结构}
+1 -1
View File
@@ -19,7 +19,7 @@
\textbf{AI 技术是如何演进的,我们应该关注哪些方向?} \textbf{AI 技术是如何演进的,我们应该关注哪些方向?}
\end{enumerate} \end{enumerate}
通过本篇学习,你将建立对 AI 的宏观认知,理解技术发展的脉络,为后续深入学习打下基础。
\section*{学习目标} \section*{学习目标}
\addcontentsline{toc}{section}{学习目标} \addcontentsline{toc}{section}{学习目标}
+16 -23
View File
@@ -970,30 +970,23 @@ print(f"真实参数: W = [2.0, 3.0], b = [1.0]")
\subsection{智能体与环境概念} \subsection{智能体与环境概念}
在《人工智能——计算Agent基础》一书\cite{MGDW8DPN}中,人工智能被定义为“一个研究能够产生智能行为的计算Agent的分析与综合的领域”,可见Agent这一概念在AI领域中的核心地位。书中进一步将Agent定义为“在某个环境中进行某种行为的个体——它完成了某件事”。由此,``人工智能的核心科学目标是理解自然系统或人工系统中一些智能行为的原理,而人工智能的核心工程目标是设计和合成有用且智能的产品'' 在《人工智能——计算Agent基础》一书\cite{MGDW8DPN}中,人工智能被定义为“一个研究能够产生智能行为的计算Agent的分析与综合的领域”,可见Agent这一概念在AI领域中的核心地位。书中进一步将Agent定义为“在某个环境中进行某种行为的个体——它完成了某件事”。由此,人工智能的核心科学目标是理解自然系统或人工系统中一些智能行为的原理,而人工智能的核心工程目标是设计和合成有用且智能的产品
因此,AI领域的基本要素便是在不同类型环境(Environment)中行动的各类智能体(Agent),执行从科学发现到实践应用等不同场景中的多种任务(Task)。总体上,环境可分为物理环境与虚拟或数字环境两大类,智能体可分为人类(含具有不同程度智能的动物)、AI与具身智能三大类(表2.1)。 因此,AI领域的基本要素便是在不同类型环境(Environment)中行动的各类智能体(Agent),执行从科学发现到实践应用等不同场景中的多种任务(Task)。总体上,环境可分为物理环境与虚拟或数字环境两大类,智能体可分为人类(含具有不同程度智能的动物)、AI与具身智能三大类(表2.1)。
\begin{longtable}[]{@{} \begin{table}[htbp]
>{\centering\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.1442}} \centering
>{\centering\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.4327}} \caption{环境-智能体的类型组合}
>{\centering\arraybackslash}p{(\linewidth - 4\tabcolsep) * \real{0.4135}}@{}} \begin{tabular}{@{} l p{5cm} p{5cm} @{}}
\caption{表 2.1 环境-智能体的类型组合}\tabularnewline \toprule
\toprule\noalign{} \diagbox{\textbf{智能体}}{\textbf{环境}} & \textbf{物理环境} & \textbf{数字环境} \\
\endfirsthead \midrule
\endhead \textbf{人类} & 具有物理身体,能直接感知和互动 & 通过设备(如电脑、手机)访问,依赖界面 \\[3pt]
\bottomrule\noalign{} \textbf{AI} & 通过机器人或嵌入式系统体现,但本质是软件 & 主要存在和运行,如算法、聊天机器人 \\[3pt]
\endlastfoot \textbf{具身智能} & 设计用于物理世界,有传感器和执行器 & 可能具有数字组件,但焦点是物理体现 \\
\textbf{环境} \bottomrule
\end{tabular}
\textbf{智能体} & \textbf{物理环境} & \textbf{数字环境} \\ \end{table}
\textbf{人类} & ~ 具有物理身体,能直接感知和互动 & ~
通过设备(如电脑、手机)访问,依赖界面 \\
\textbf{AI} & ~ 通过机器人或嵌入式系统体现,但本质是软件 & ~
主要存在和运行,如算法、聊天机器人 \\
\textbf{具身智能} & ~ 设计用于物理世界,有传感器和执行器 & ~
可能具有数字组件,但焦点是物理体现 \\
\end{longtable}
其中,人类与物理环境的互动长久以来是地理学科的研究主题,即“人地关系”或“人地耦合系统”研究,涉及环境感知、景观设计、可持续性等多个议题。当前的“智能体---环境”关系研究可视为“人地关系”研究的自然延伸,可从中汲取丰富启发,有待后续深入探讨。人类与数字环境的互动则关联网络社会、人机交互等主题,在AI蓬勃发展的时代背景下催生了更多、更深刻的研究命题。AI与具身智能分别对应数字环境和物理环境,构成了人工智能的两种主要存在方式。 其中,人类与物理环境的互动长久以来是地理学科的研究主题,即“人地关系”或“人地耦合系统”研究,涉及环境感知、景观设计、可持续性等多个议题。当前的“智能体---环境”关系研究可视为“人地关系”研究的自然延伸,可从中汲取丰富启发,有待后续深入探讨。人类与数字环境的互动则关联网络社会、人机交互等主题,在AI蓬勃发展的时代背景下催生了更多、更深刻的研究命题。AI与具身智能分别对应数字环境和物理环境,构成了人工智能的两种主要存在方式。
@@ -1008,7 +1001,7 @@ print(f"真实参数: W = [2.0, 3.0], b = [1.0]")
\begin{figure} \begin{figure}
\centering \centering
\includegraphics[width=4.15529in,height=3.58481in,alt={图 2.1 智能体-环境互动框架}]{figures/ch02/image1.png} \includegraphics[width=4.15529in,height=3.58481in,alt={图 2.1 智能体-环境互动框架}]{figures/ch02/image1.png}
\caption{图 2.1 智能体-环境互动框架} \caption{智能体-环境互动框架}
\end{figure} \end{figure}
\subsection{"环境-智能体"框架与设计任务} \subsection{"环境-智能体"框架与设计任务}
@@ -1026,7 +1019,7 @@ Agent在环境中的行为充满复杂性,这些复杂性可以分解为不同
\begin{longtable}[]{@{} \begin{longtable}[]{@{}
>{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.2083}} >{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.2083}}
>{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.5694}}@{}} >{\raggedright\arraybackslash}p{(\linewidth - 2\tabcolsep) * \real{0.5694}}@{}}
\caption{表 2.2 智能系统设计空间的复杂性维度}\tabularnewline \caption{智能系统设计空间的复杂性维度}\tabularnewline
\toprule\noalign{} \toprule\noalign{}
\endfirsthead \endfirsthead
\endhead \endhead
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

+12 -2
View File
@@ -1,3 +1,4 @@
\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[a4paper,openany,12pt]{ctexbook} \documentclass[a4paper,openany,12pt]{ctexbook}
% ========== 宏包与全局设置 ========== % ========== 宏包与全局设置 ==========
@@ -5,8 +6,8 @@
% ========== 标题信息 ========== % ========== 标题信息 ==========
\title{\Huge\textbf{设计人工智能:基础与应用} \\[1em] \Large Design AI: Fundamentals and Applications} \title{\Huge\textbf{设计人工智能:基础与应用} \\[1em] \Large Design AI: Fundamentals and Applications}
\author{彭晓} \author{彭晓 \\ \small 空间智能与自主设计实验室}
\date{2026年4} \date{2026年5}
% ========== 按章编译开关 ========== % ========== 按章编译开关 ==========
% 取消注释以只编译特定章节(加速调试) % 取消注释以只编译特定章节(加速调试)
@@ -19,6 +20,15 @@
\maketitle \maketitle
\thispagestyle{empty} \thispagestyle{empty}
% ---------- 故意留白 ----------
\clearpage
\vspace*{\fill}
\begin{center}
\small\textcolor{gray}{此页故意留白}
\end{center}
\vspace*{\fill}
\thispagestyle{empty}
% ---------- 前言部分 ---------- % ---------- 前言部分 ----------
\frontmatter \frontmatter
\input{chapters/ch00-preface} \input{chapters/ch00-preface}
+10 -2
View File
@@ -3,7 +3,7 @@
% ========== 行距 ========== % ========== 行距 ==========
\usepackage{setspace} \usepackage{setspace}
\onehalfspacing \doublespacing
% ========== 修复页眉高度警告 ========== % ========== 修复页眉高度警告 ==========
\setlength{\headheight}{14.49998pt} \setlength{\headheight}{14.49998pt}
@@ -26,6 +26,7 @@
\usepackage{tabularx} \usepackage{tabularx}
\usepackage{multirow} \usepackage{multirow}
\usepackage{longtable} \usepackage{longtable}
\usepackage{diagbox}
% ========== 图形 ========== % ========== 图形 ==========
\usepackage{graphicx} \usepackage{graphicx}
@@ -48,7 +49,8 @@
} }
% ========== 颜色 ========== % ========== 颜色 ==========
\usepackage{xcolor} \usepackage[dvipsnames]{xcolor}
\definecolor{GREEN}{RGB}{0,128,0}
% ========== 超链接 ========== % ========== 超链接 ==========
\usepackage{hyperref} \usepackage{hyperref}
@@ -94,3 +96,9 @@
format = \large\bfseries, format = \large\bfseries,
}, },
} }
% ========== 章节编号深度 ==========
\setcounter{secnumdepth}{3}
% ========== 绿色底色标题 ==========
\newcommand{\greenheading}[1]{\texorpdfstring{\colorbox{green!20}{\ #1\ }}{#1}}