Newer
Older
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# An Introduction To Using `aima-python` \n",
"*Author: Chirag Vartak* \n",
"*Date: 14th March 2016* \n",
" \n",
"## About `aima-python` \n",
" \n",
" As I suspect you might already know, the repository [aima-python](https://github.com/aimacode/aima-python) implements in Python code, the algorithms in the textbook *Artificial Intelligence: A Modern Approach*. You can find these algorithms in the various modules of this repository. Typically, each module has the code for a single chapter in the book, but some modules may have code from more than two chapters in it. Most of the algorithms given in the figures of the book have been implemented. If you are looking for a particular algorithm or have trouble finding the module for the chapter you are interested in, [this index](https://github.com/aimacode/aima-python#index-of-code) might prove to be useful. The code in this repository takes care to implement the algorithms in the figures of the book *exactly as they are*. We have tried our best to write our code as close as we could to the pseudocodes in the textbook, and haven't done any optimizations to it that may hamper with code readability. The intention of this code is to be readable, so that you can relate it to the algorithms in the textbook. For algorithms that we thought really needed optimizations, we have written these seperately as different functions and stated so in comments. Also, before we proceed, I should let you know that if you are more comfortable with Java than you are with Python we also have the [aima-java](https://github.com/aimacode/aima-java) repository. \n",
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
" \n",
"## What version of Python?\n",
" \n",
" The version of Python using which we have written and tested the code is Python 3.4. While running the code using Python 3.4 would be ideal, it should run fine on any Python 3.x. If you find that some function or module gives rise to errors on a different version of Python 3 which you are using, we would be glad if you could report it as an [Issue](https://github.com/aimacode/aima-python/issues). As far as Python 2 is concerned, the code simply will not work and produce too many errors. So, please *do not use the code in this repository with Python 2*. If, for some reason, you cannot obtain access to Python 3, we do have a [legacy branch](https://github.com/aimacode/aima-python/tree/aima3python2) that was developed a long time ago and was intended to work with Python 2. Not all modules have been implemented in this branch and its development and maintainence have been stopped. \n",
" \n",
"## Installing Anaconda\n",
" \n",
" If you have Python installed on your computer directly from python.org, you should be able to get the code in this repository to run just fine. But what we prefer is that you get [Anaconda](https://www.continuum.io/downloads) installed on your computer. Anaconda is a completely free Python distribution and has recently gotten quite popular in the Python scientific computing community. Plus, it comes with additional tools like the powerful IPython interpreter, the Jupyter Notebook App and many essential software packages. After installing Anaconda, you will be good to go to use these IPython notebooks. Also, you can run code with multiple versions of Python using what they call [virtual environments](http://conda.pydata.org/docs/py2or3.html).\n",
"\n",
"## Using these IPython notebooks \n",
" \n",
" An IPython notebook in this repository explains how to use a particular module and gives examples of its usage. An IPython notebook explains the module with the same name. For example, `games.ipynb` helps you with using the `games.py` module. A notebook has some content telling you more about the code in the module and some examples at the end which you can run in the notebook itself. \n",
" \n",
" You can use these IPython notebook in two ways: either you can view them as static HTML pages in your browser by clicking on their links in this repository on Gitub, or, you can download these notebooks and use them with a notebook app like Jupyter. (If you plan to use these notebooks with a notebook app, download the entire repository and then do so; a notebook might have some files it needs in the repo.) A notebook app allows you to run the code interactively in the browser, but if you just want to take a fleeting look at the notebook, viewing it as a static HTML page would be great too. \n",
" \n",
" If you don't know what IPython notebooks or the Jupyter Notebook App are or have never used them before, then I suggest [you read a bit](https://jupyter-notebook-beginner-guide.readthedocs.org/en/latest/) about them. Then, you might want to get your hands dirty and [get started](https://nbviewer.jupyter.org/github/jupyter/notebook/blob/master/docs/source/examples/Notebook/Running%20Code.ipynb). If you want to explore IPython notebooks some more before you get started with this repository, [this wiki page](https://github.com/ipython/ipython/wiki/A-gallery-of-interesting-IPython-Notebooks) has some truly amazing example notebooks. If you want to work with a specific version of Python, [virtual environments](http://conda.pydata.org/docs/py2or3.html) might be what you are looking for. To run the IPython interpreter or the Jupyter Notebook App with a specific version of Python, just create the particular virtual environment in the terminal and proceed as you normally would."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",