<div align="center">
<a href="http://aima.cs.berkeley.edu/"><img src="https://raw.githubusercontent.com/aimacode/aima-python/master/images/aima_logo.png"></a><br><br>
</div>
# `aima-python` [![Build Status](https://travis-ci.org/aimacode/aima-python.svg?branch=master)](https://travis-ci.org/aimacode/aima-python) [![Binder](http://mybinder.org/badge.svg)](http://mybinder.org/repo/aimacode/aima-python)
Python code for the book *[Artificial Intelligence: A Modern Approach](http://aima.cs.berkeley.edu).* You can use this in conjunction with a course on AI, or for study on your own. We're looking for [solid contributors](https://github.com/aimacode/aima-python/blob/master/CONTRIBUTING.md) to help.
## Structure of the Project
When complete, this project will have Python implementations for all the pseudocode algorithms in the book, as well as tests and examples of use. For each major topic, such as `nlp` (natural language processing), we provide the following files:
- `nlp.py`: Implementations of all the pseudocode algorithms, and necessary support functions/classes/data.
- `tests/test_nlp.py`: A lightweight test suite, using `assert` statements, designed for use with [`py.test`](http://pytest.org/latest/), but also usable on their own.
- `nlp.ipynb`: A Jupyter (IPython) notebook that explains and gives examples of how to use the code.
- `nlp_apps.ipynb`: A Jupyter notebook that gives example applications of the code.
## Python 3.4 and up
This code requires Python 3.4 or later, and does not run in Python 2. You can [install Python](https://www.python.org/downloads) or use a browser-based Python interpreter such as [repl.it](https://repl.it/languages/python3).
You can run the code in an IDE, or from the command line with `python -i filename.py` where the `-i` option puts you in an interactive loop where you can run Python functions. All notebooks are available in a [binder environment](http://mybinder.org/repo/aimacode/aima-python). Alternatively, visit [jupyter.org](http://jupyter.org/) for instructions on setting up your own Jupyter notebook environment.
## Installation Guide
To download the repository:
`git clone https://github.com/aimacode/aima-python.git`
Then you need to install the basic dependencies to run the project on your system:
`pip install -r requirements.txt`
You also need to fetch the datasets from the [`aima-data`](https://github.com/aimacode/aima-data) repository:
```
cd aima-python
git submodule init
git submodule update
```
Wait for the datasets to download, it may take a while. Once they are downloaded, you need to install `pytest`, so that you can run the test suite:
`pip install pytest`
Then to run the tests:
`py.test`
And you are good to go!
# Index of Algorithms
Here is a table of algorithms, the figure, name of the algorithm in the book and in the repository, and the file where they are implemented in the repository. This chart was made for the third edition of the book and is being updated for the upcoming fourth edition. Empty implementations are a good place for contributors to look for an issue. The [aima-pseudocode](https://github.com/aimacode/aima-pseudocode) project describes all the algorithms from the book. An asterisk next to the file name denotes the algorithm is not fully implemented. Another great place for contributors to start is by adding tests and writing on the notebooks. You can see which algorithms have tests and notebook sections below. If the algorithm you want to work on is covered, don't worry! You can still add more tests and provide some examples of use in the notebook!
| **Figure** | **Name (in 3<sup>rd</sup> edition)** | **Name (in repository)** | **File** | **Tests** | **Notebook**
|:-------|:----------------------------------|:------------------------------|:--------------------------------|:-----|:---------|
| 2 | Random-Vacuum-Agent | `RandomVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2 | Model-Based-Vacuum-Agent | `ModelBasedVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.1 | Environment | `Environment` | [`agents.py`][agents] | Done | Included |
| 2.1 | Agent | `Agent` | [`agents.py`][agents] | Done | Included |
| 2.3 | Table-Driven-Vacuum-Agent | `TableDrivenVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.7 | Table-Driven-Agent | `TableDrivenAgent` | [`agents.py`][agents] | Done | Included |
| 2.8 | Reflex-Vacuum-Agent | `ReflexVacuumAgent` | [`agents.py`][agents] | Done | Included |
| 2.10 | Simple-Reflex-Agent | `SimpleReflexAgent` | [`agents.py`][agents] | Done | Included |
| 2.12 | Model-Based-Reflex-Agent | `ReflexAgentWithState` | [`agents.py`][agents] | Done | Included |
| 3 | Problem | `Problem` | [`search.py`][search] | Done | Included |
| 3 | Node | `Node` | [`search.py`][search] | Done | Included |
| 3 | Queue | `Queue` | [`utils.py`][utils] | Done | No Need |
| 3.1 | Simple-Problem-Solving-Agent | `SimpleProblemSolvingAgent` | [`search.py`][search] | Done | Included |
| 3.2 | Romania | `romania` | [`search.py`][search] | Done | Included |
| 3.7 | Tree-Search | `depth/breadth_first_tree_search` | [`search.py`][search] | Done | Included |
| 3.7 | Graph-Search | `depth/breadth_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.11 | Breadth-First-Search | `breadth_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.14 | Uniform-Cost-Search | `uniform_cost_search` | [`search.py`][search] | Done | Included |
| 3.17 | Depth-Limited-Search | `depth_limited_search` | [`search.py`][search] | Done | Included |
| 3.18 | Iterative-Deepening-Search | `iterative_deepening_search` | [`search.py`][search] | Done | Included |
| 3.22 | Best-First-Search | `best_first_graph_search` | [`search.py`][search] | Done | Included |
| 3.24 | A\*-Search | `astar_search` | [`search.py`][search] | Done | Included |
| 3.26 | Recursive-Best-First-Search | `recursive_best_first_search` | [`search.py`][search] | Done | Included |
| 4.2 | Hill-Climbing | `hill_climbing` | [`search.py`][search] | Done | Included |
| 4.5 | Simulated-Annealing | `simulated_annealing` | [`search.py`][search] | Done | Included |
| 4.8 | Genetic-Algorithm | `genetic_algorithm` | [`search.py`][search] | Done | Included |
| 4.11 | And-Or-Graph-Search | `and_or_graph_search` | [`search.py`][search] | Done | Included |
| 4.21 | Online-DFS-Agent | `online_dfs_agent` | [`search.py`][search] | Done | Included |
| 4.24 | LRTA\*-Agent | `LRTAStarAgent` | [`search.py`][search] | Done | Included |
| 5.3 | Minimax-Decision | `minimax_decision` | [`games.py`][games] | Done | Included |
| 5.7 | Alpha-Beta-Search | `alphabeta_search` | [`games.py`][games] | Done | Included |
| 6 | CSP
没有合适的资源?快使用搜索试试~ 我知道了~
Python-来自Russell和Norvig的人工智能中算法的Python实现
共158个文件
py:56个
ipynb:31个
png:26个
需积分: 9 4 下载量 54 浏览量
2019-08-10
03:11:51
上传
评论
收藏 3.83MB ZIP 举报
温馨提示
来自Russell和Norvig的人工智能中算法的Python实现
资源推荐
资源详情
资源评论
收起资源包目录
Python-来自Russell和Norvig的人工智能中算法的Python实现 (158个子文件)
.coveragerc 28B
.flake8 131B
.gitignore 914B
.gitmodules 91B
IMAGE-CREDITS 377B
pytest.ini 54B
pytest.ini 53B
search.ipynb 662KB
learning.ipynb 648KB
learning_apps.ipynb 541KB
probability.ipynb 396KB
search4e.ipynb 323KB
mdp.ipynb 274KB
logic.ipynb 260KB
obsolete-search-4e.ipynb 258KB
planning.ipynb 243KB
csp.ipynb 232KB
planning_partial_order_planner.ipynb 84KB
mdp_apps.ipynb 83KB
planning_graphPlan.ipynb 82KB
knowledge_version_space.ipynb 58KB
games.ipynb 48KB
games4e.ipynb 47KB
knowledge_FOIL.ipynb 46KB
nlp.ipynb 46KB
neural_nets.ipynb 46KB
probability-4e.ipynb 39KB
nlp_apps.ipynb 39KB
planning_angelic_search.ipynb 37KB
knowledge_current_best.ipynb 37KB
text.ipynb 36KB
planning_hierarchical_search.ipynb 34KB
vacuum_world.ipynb 29KB
agents.ipynb 27KB
rl.ipynb 21KB
planning_total_order_planner.ipynb 18KB
intro.ipynb 6KB
index.ipynb 2KB
pop.jpg 107KB
model_utility_based_agent.jpg 68KB
model_goal_based_agent.jpg 60KB
model_based_reflex_agent.jpg 56KB
aima3e_big.jpg 56KB
decisiontree_fruit.jpg 45KB
cake_graph.jpg 43KB
sprinklernet.jpg 42KB
simple_reflex_agent.jpg 40KB
simple_problem_solving_agent.jpg 40KB
wall-icon.jpg 35KB
general_learning_agent.jpg 32KB
ge2.jpg 26KB
ge4.jpg 23KB
4.jpg 21KB
ge1.jpg 21KB
ge0.jpg 20KB
-0.4.jpg 20KB
-4.jpg 19KB
-0.04.jpg 17KB
ensemble_learner.jpg 16KB
grid_mdp.jpg 13KB
grid_mdp_agent.jpg 6KB
dirt05-icon.jpg 2KB
vacuum-icon.jpg 1KB
gridworld.js 4KB
canvas.js 4KB
continuousworld.js 2KB
LICENSE 1KB
makefile 562B
README.md 17KB
CONTRIBUTING.md 10KB
SUBMODULE.md 599B
broxrevised.png 229KB
random_forest.png 186KB
restaurant.png 171KB
stapler1-test.png 131KB
bayesnet.png 79KB
refinement.png 62KB
fig_5_2.png 48KB
knn_plot.png 44KB
knowledge_foil_family.png 35KB
hillclimb-tsp.png 31KB
mdp-a.png 31KB
neural_net.png 24KB
mdp-d.png 21KB
perceptron.png 19KB
mdp-c.png 18KB
knowledge_FOIL_grandparent.png 18KB
mdp-b.png 17KB
romania_map.png 15KB
queen_s.png 14KB
parse_tree.png 13KB
pluralityLearner_plot.png 12KB
aima_logo.png 8KB
uniform_crossover.png 6KB
point_crossover.png 6KB
maze.png 4KB
mdp.png 824B
planning.py 65KB
search.py 54KB
logic.py 53KB
共 158 条
- 1
- 2
资源评论
weixin_39841856
- 粉丝: 491
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功