MLCC 的编程练习可以 Jupyter 笔记本 (.ipynb
) 格式下载。如需在本地机器上运行练习,请执行以下操作:
下载练习
在此处下载 .zip 格式的练习:
。 http://并将文件解压缩到您选择的位置。
接下来,请按照适用于您的操作系统的相应说明安装并运行 Jupyter。
在 Windows 上安装并运行 Jupyter
- 从 https://www.anaconda.com/download 安装 Python 3.6 版本的 Anaconda。这些练习不适用于 Python 2.7 版本。
安装后,从“开始”菜单打开 Anaconda Prompt,然后输入以下命令:
conda create -n mlcc pip python=3.6
conda activate mlcc
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed --upgrade \ tensorflow matplotlib pandas sklearn scipy seaborn
完成所有软件包的安装后,从“开始”菜单中打开 Anaconda Navigator。在 Navigator 中:
- 切换到
mlcc
环境,如以下屏幕截图所示。每次打开 Jupyter 时,都必须选择mlcc
环境。 在
mlcc
环境中安装notebook
,如下所示:安装
notebook
后,点击 Launch。这将打开一个网络浏览器。
- 切换到
接下来,运行练习。
在 Mac OS X 上安装并运行 Jupyter
如果您尚未安装 XCode,请通过运行以下命令安装它(这需要一段时间):
xcode-select --install
安装
pip
和virtualenv
:sudo easy_install pip virtualenv
在新目录中设置虚拟环境(这里我们称之为“mlcc-exercises”):
mkdir mlcc-exercises
cd mlcc-exercises
virtualenv --no-site-package jupyter-env
设置并运行 Jupyter。
- 进入虚拟环境:
source jupyter-env/bin/activate
- 安装库:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed --upgrade \ tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
- 启动 Jupyter:
jupyter notebook
- 进入虚拟环境:
接下来,运行练习。
在 Linux 上安装并运行 Jupyter
安装 Python 和
pip
:sudo apt-get install python-dev python-pip
在新目录中设置虚拟环境(这里我们称之为
mlcc-exercises
):mkdir mlcc-exercises
cd mlcc-exercises
virtualenv --no-site-package jupyter-env
设置并运行 Jupyter。
- 进入虚拟环境:
source jupyter-env/bin/activate
- 安装库:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed --upgrade \ tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
- 启动 Jupyter:
jupyter notebook
- 进入虚拟环境:
接下来,运行练习。
跑步锻炼
安装并启动 Jupyter 后,在 Jupyter 网页界面中,转到解压缩练习的位置:
点击要打开的练习所对应的链接。