プリンキピア

第23章付録:深層学習のための道具

23.6.3. Submitting Major Changes23.6.3 大きな変更を提出する

We suggest you to use the standard Git process to submit a major change. In a nutshell the process works as described in Fig. 23.6.2.
英語のヒント
大きな変更を出すには、標準的なGitの手順を使うことを勧める。手短に言えば、手順は図23.6.2で述べるように進む。
Fig. 23.6.2図23.6.2
Contributing to the book.
英語のヒント
本書に貢献する。
We will walk you through the steps in detail. If you are already familiar with Git you can skip this section. For concreteness we assume that the contributor’s user name is “astonzhang”.
英語のヒント
手順を詳しく案内する。すでにGitに慣れているなら、この節は飛ばしてよい。具体的にするため、貢献者のユーザー名は「astonzhang」だとする。

23.6.3.1. Installing Git23.6.3.1 Gitをインストールする

The Git open-source book describes how to install Git. This typically works via apt install git on Ubuntu Linux, by installing the Xcode developer tools on macOS, or by using GitHub’s desktop client. If you do not have a GitHub account, you need to sign up for one.
英語のヒント
Gitのオープンソースの本には、Gitのインストール方法が述べられている。ふつうは、Ubuntu Linuxではapt install gitで、macOSではXcodeの開発者ツールをインストールすることで、あるいはGitHubのデスクトップクライアントを使うことでできる。GitHubのアカウントがないなら、登録する必要がある。

23.6.3.2. Logging in to GitHub23.6.3.2 GitHubにログインする

Enter the address of the book’s code repository in your browser. Click on the Fork button in the red box at the upper-right of Fig. 23.6.3, to make a copy of the repository of this book. This is now your copy and you can change it any way you want.
英語のヒント
ブラウザに本書のコードのリポジトリのアドレスを入力する。図23.6.3の右上の赤い枠の中のForkボタンをクリックして、本書のリポジトリのコピーを作る。これはもうあなたのコピーであり、好きなように変更できる。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 23.6.3図23.6.3
The code repository page.
英語のヒント
コードのリポジトリのページ。
Now, the code repository of this book will be forked (i.e., copied) to your username, such as astonzhang/d2l-en shown at the upper-left of Fig. 23.6.4.
英語のヒント
これで、本書のコードのリポジトリが、図23.6.4の左上に示したastonzhang/d2l-enのように、あなたのユーザー名にフォークされる(つまりコピーされる)。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 23.6.4図23.6.4
The forked code repository.
英語のヒント
フォークしたコードのリポジトリ。

23.6.3.3. Cloning the Repository23.6.3.3 リポジトリをクローンする

To clone the repository (i.e., to make a local copy) we need to get its repository address. The green button in Fig. 23.6.5 displays this. Make sure that your local copy is up to date with the main repository if you decide to keep this fork around for longer. For now simply follow the instructions in Installation to get started. The main difference is that you are now downloading your own fork of the repository.
英語のヒント
リポジトリをクローンする(つまりローカルのコピーを作る)には、そのリポジトリのアドレスを手に入れる必要がある。図23.6.5の緑のボタンがこれを表示する。このフォークをもっと長く手元に置いておくことにしたなら、ローカルのコピーをメインのリポジトリに合わせて最新に保つようにしよう。今のところは、インストールの手順に従って始めればよい。主な違いは、今度はリポジトリの自分のフォークをダウンロードしていることである。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 23.6.5図23.6.5
Cloning the repository.
英語のヒント
リポジトリをクローンする。
# Replace your_github_username with your GitHub username
git clone https://github.com/your_github_username/d2l-en.git

23.6.3.4. Editing and Pushing23.6.3.4 編集してプッシュする

Now it is time to edit the book. It is best to edit it in the Jupyter Notebook following instructions in Section 23.1. Make the changes and check that they are OK. Assume that we have modified a typo in the file ~/d2l-en/chapter_appendix-tools-for-deep-learning/contributing.md. You can then check which files you have changed.
英語のヒント
いよいよ本書を編集するときである。23.1節の手順に従って、Jupyter Notebookで編集するのが最善である。変更を加え、問題がないことを確かめる。ファイル~/d2l-en/chapter_appendix-tools-for-deep-learning/contributing.mdの誤字を修正したとしよう。それから、どのファイルを変更したかを確認できる。
At this point Git will prompt that the chapter_appendix-tools-for-deep-learning/contributing.md file has been modified.
英語のヒント
この時点で、Gitは、chapter_appendix-tools-for-deep-learning/contributing.mdファイルが修正されたことを知らせる。
mylaptop:d2l-en me$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   chapter_appendix-tools-for-deep-learning/contributing.md
After confirming that this is what you want, execute the following command:
英語のヒント
これが望むものであることを確認したら、次のコマンドを実行する。
git add chapter_appendix-tools-for-deep-learning/contributing.md
git commit -m 'Fix a typo in git documentation'
git push
The changed code will then be in your personal fork of the repository. To request the addition of your change, you have to create a pull request for the official repository of the book.
英語のヒント
すると、変更したコードはリポジトリの個人のフォークに入る。変更の追加を依頼するには、本書の公式のリポジトリに対してプルリクエストを作る必要がある。

23.6.3.5. Submitting Pull Requests23.6.3.5 プルリクエストを出す

As shown in Fig. 23.6.6, go to your fork of the repository on GitHub and select “New pull request”. This will open up a screen that shows you the changes between your edits and what is current in the main repository of the book.
英語のヒント
図23.6.6に示すように、GitHub上のリポジトリの自分のフォークに行き、「New pull request」を選ぶ。すると、自分の編集と本書のメインのリポジトリの現状との間の変更を示す画面が開く。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 23.6.6図23.6.6
New pull request.
英語のヒント
新しいプルリクエスト。
Finally, submit a pull request by clicking the button as shown in Fig. 23.6.7. Make sure to describe the changes you have made in the pull request. This will make it easier for the authors to review it and to merge it with the book. Depending on the changes, this might get accepted right away, rejected, or more likely, you will get some feedback on the changes. Once you have incorporated them, you are good to go.
英語のヒント
最後に、図23.6.7に示すようにボタンをクリックしてプルリクエストを出す。プルリクエストで加えた変更を必ず説明しよう。そうすれば、著者がそれをレビューして本書にマージしやすくなる。変更によっては、すぐに受け入れられたり、却下されたりするかもしれないが、もっとありそうなのは、変更についていくつかのフィードバックをもらうことである。それらを取り込めば、準備完了である。
Image omitted because its reuse rights could not be verified.権利の確認ができないため画像を割愛。
Fig. 23.6.7図23.6.7
Create pull request.
英語のヒント
プルリクエストを作る。