プリンキピア

前付けインストール

Downloading and Running the Code コードのダウンロードと実行

Next, you will want to download the notebooks so that you can run each of the book’s code blocks. Simply click on the “Notebooks” tab at the top of any HTML page on the D2L.ai website to download the code and then unzip it. Alternatively, you can fetch the notebooks from the command line as follows:
英語のヒント
次に、本のコードブロックをそれぞれ実行できるように、ノートブックをダウンロードしたくなるだろう。D2L.aiのWebサイトのどのHTMLページでも、上部の「Notebooks」タブをクリックするだけでコードをダウンロードできるので、それを展開する。あるいは、次のようにコマンドラインからノートブックを取得してもよい。
mkdir d2l-en && cd d2l-en
curl https://d2l.ai/d2l-en-1.0.3.zip -o d2l-en.zip
unzip d2l-en.zip && rm d2l-en.zip
cd pytorch
If you do not already have unzip installed, first run sudo apt-get install unzip. Now we can start the Jupyter Notebook server by running:
英語のヒント
unzipがまだ入っていなければ、まずsudo apt-get install unzipを実行する。これで、次を実行してJupyter Notebookのサーバーを起動できる。
jupyter notebook
At this point, you can open http://localhost:8888 (it may have already opened automatically) in your web browser. Then we can run the code for each section of the book. Whenever you open a new command line window, you will need to execute conda activate d2l to activate the runtime environment before running the D2L notebooks, or updating your packages (either the deep learning framework or the d2l package). To exit the environment, run conda deactivate.
英語のヒント
この時点で、Webブラウザでhttp://localhost:8888を開けばよい(すでに自動で開いているかもしれない)。そうすれば、本の各節のコードを実行できる。新しいコマンドラインのウィンドウを開くたびに、D2Lのノートブックを実行したり、パッケージ(深層学習フレームワークかd2lパッケージ)を更新したりする前に、conda activate d2lを実行して実行環境を有効にする必要がある。環境から抜けるには、conda deactivateを実行する。