在本地运行编程练习

MLCC 的编程练习可以 Jupyter 笔记本 (.ipynb) 格式下载。如需在本地机器上运行练习,请执行以下操作:

  1. 下载练习
  2. 安装并运行 Jupyter:
  3. 运行练习

下载练习

在此处下载 .zip 格式的练习:

http://

并将文件解压缩到您选择的位置。

接下来,请按照适用于您的操作系统的相应说明安装并运行 Jupyter。

在 Windows 上安装并运行 Jupyter

  1. https://www.anaconda.com/download 安装 Python 3.6 版本的 Anaconda。这些练习适用于 Python 2.7 版本。
  2. 安装后,从“开始”菜单打开 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
    
  3. 完成所有软件包的安装后,从“开始”菜单中打开 Anaconda Navigator。在 Navigator 中:

    1. 切换到 mlcc 环境,如以下屏幕截图所示。每次打开 Jupyter 时,都必须选择 mlcc 环境。Anaconda Navigator 的屏幕截图,包含从“环境”下拉菜单中选择的“mlcc”
    2. mlcc 环境中安装 notebook,如下所示: Anaconda Navigator 的屏幕截图,一个箭头指向 Jupyter 的“安装”按钮

    3. 安装 notebook 后,点击 Launch。这将打开一个网络浏览器。

接下来,运行练习

在 Mac OS X 上安装并运行 Jupyter

  1. 如果您尚未安装 XCode,请通过运行以下命令安装它(这需要一段时间):

    xcode-select --install
    
  2. 安装 pipvirtualenv

    sudo easy_install pip virtualenv
    
  3. 在新目录中设置虚拟环境(这里我们称之为“mlcc-exercises”):

    mkdir mlcc-exercises
    cd mlcc-exercises
    virtualenv --no-site-package jupyter-env
    
  4. 设置并运行 Jupyter。

    1. 进入虚拟环境:
      source jupyter-env/bin/activate
      
    2. 安装库:
      pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed --upgrade \
        tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
      
    3. 启动 Jupyter:
      jupyter notebook
      

接下来,运行练习

在 Linux 上安装并运行 Jupyter

  1. 安装 Python 和 pip

    sudo apt-get install python-dev python-pip
    
  2. 在新目录中设置虚拟环境(这里我们称之为 mlcc-exercises):

    mkdir mlcc-exercises
    cd mlcc-exercises
    virtualenv --no-site-package jupyter-env
    
  3. 设置并运行 Jupyter。

    1. 进入虚拟环境:
      source jupyter-env/bin/activate
      
    2. 安装库:
      pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --ignore-installed --upgrade \
        tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
      
    3. 启动 Jupyter:
      jupyter notebook
      

接下来,运行练习

跑步锻炼

安装并启动 Jupyter 后,在 Jupyter 网页界面中,转到解压缩练习的位置:

Jupyter 文件浏览器界面的屏幕截图,并且 &#39;mlcc-exercises&#39; 目录已圈定。

点击要打开的练习所对应的链接。