You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+158-2
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,8 @@ We look forward to receiving your pull requests for:
22
22
23
23
## How to contribute
24
24
25
-
To contribute, send us a pull request. For small changes, such as fixing a typo or adding a link, you can use the [GitHub Edit Button](https://blog.github.com/2011-04-26-forking-with-the-edit-button/). For larger changes:
25
+
To contribute, start by reading [contributing section](https://d2l.ai/chapter_appendix-tools-for-deep-learning/contributing.html) and eventually
26
+
send us a pull request. For small changes, such as fixing a typo or adding a link, you can use the [GitHub Edit Button](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). For larger changes:
26
27
27
28
1.[Fork the repository](https://help.github.com/articles/fork-a-repo/).
28
29
2. In your fork, make your change in a new branch (e.g., by [`git branch`](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging)) that's based on this repo's **master** branch.
@@ -39,10 +40,165 @@ For contributions that will take a significant amount of time, [open a new issue
39
40
40
41
## Finding contributions to work on
41
42
42
-
If you'd like to contribute, but don't have a project in mind, look at the [open issues](https://github.com/d2l-ai/d2l-en/issues) in this repository for some ideas. Any issues with the [help wanted](https://github.com/d2l-ai/d2l-en/labels/help%20wanted) or [enhancement](https://github.com/d2l-ai/d2l-en/labels/enhancement) labels are a great place to start.
43
+
If you'd like to contribute, but don't have a project in mind, look at the [open issues](https://github.com/d2l-ai/d2l-en/issues) in this repository for some ideas. Issues with the [help wanted](https://github.com/d2l-ai/d2l-en/labels/help%20wanted), [good first issue](https://github.com/d2l-ai/d2l-en/labels/good%20first%20issue) or [enhancement](https://github.com/d2l-ai/d2l-en/labels/enhancement) labels are a great place to start.
43
44
44
45
In addition to written content, we really appreciate new examples and code samples for our documentation, such as examples for different platforms or environments, and code samples in additional languages.
45
46
47
+
48
+
## How to change code in one of the frameworks?
49
+
50
+
This section describes the development environment setup and workflow
51
+
which should be followed when modifying/porting python code and making
52
+
changes to one of the machine learning frameworks in the book.
53
+
We follow a set of pre-defined [style guidelines](https://github.com/d2l-ai/d2l-en/blob/master/STYLE_GUIDE.md)
54
+
for consistent code quality throughout the book and expect the same
55
+
from our community contributors. You may need to check other chapters
56
+
from other contributors as well for this step.
57
+
58
+
All the chapter sections are generated from markdown (.md file, not .ipynb file)
59
+
source files. When making changes in code, for the ease of development
60
+
and making sure it is error free, we never edit the markdown files directly.
61
+
Instead we can read/load these markdown files as jupyter notebooks
62
+
and then make the required changes in the notebook to edit the markdown
63
+
file automatically (more on that below). This way, before raising the PR,
64
+
one can easily test the changes locally in the jupyter notebook.
After that, you only need to run the jupyter notebook
156
+
command to turn on the notedown plugin by default.
157
+
158
+
Please refer to the section on [markdown files in jupyter](https://d2l.ai/chapter_appendix-tools-for-deep-learning/jupyter.html#markdown-files-in-jupyter)
159
+
for more details.
160
+
161
+
162
+
#### d2lbook activate
163
+
164
+
Now to start working on a particular framework for a section,
165
+
only activate the framework tab you wish to use,
166
+
like this -> `d2lbook activate <framework_name> chapter_preliminaries/ndarray.md`,
167
+
so the `<framework_name>` code blocks become python blocks and
168
+
other frameworks are ignored when running the notebook.
169
+
170
+
When you are done editing a notebook, please save it and
171
+
remember to strictly clear all outputs and activate all
172
+
tabs by using `d2lbook activate`.
173
+
174
+
```bash
175
+
# Example
176
+
d2lbook activate all chapter_preliminaries/ndarray.md`
177
+
```
178
+
179
+
#### d2lbook build lib
180
+
181
+
Note: Remember to mark a functionwhich will be reused later by
182
+
`#save` and in the end when all the above steps are completed
183
+
just run the following in the root directory to copy all the
184
+
saved functions/classes into `d2l/<framework_name>.py`
185
+
186
+
```bash
187
+
d2lbook build lib
188
+
```
189
+
190
+
If the saved functions require some packages to be imported, you can add
191
+
them to `chapter_preface/index.md` under the respective framework tab and
192
+
run `d2lbook build lib`. Now the import will also be reflected in the d2l
193
+
library after running and the saved functions can access the imported lib.
194
+
195
+
NOTE: Ensure that the output/results are consistent after the change, across the frameworks, by multiple runs of the notebook locally.
196
+
197
+
198
+
Finally send in a PR, if all checks succeed, with a review of the PR from the authors, your contributions shall be merged. :)
199
+
200
+
Hope this is comprehensive enough to get you started. Feel free to ask the authors and other contributors incase of any doubt. We always welcome feedback.
201
+
46
202
## Code of conduct
47
203
48
204
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information, see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
[Book website](https://d2l.ai/) | [STAT 157 Course at UC Berkeley, Spring 2019](http://courses.d2l.ai/berkeley-stat-157/index.html)
9
+
[Book website](https://d2l.ai/) | [STAT 157 Course at UC Berkeley](http://courses.d2l.ai/berkeley-stat-157/index.html)
10
10
11
11
<h5align="center"><i>The best way to understand deep learning is learning by doing.</i></h5>
12
12
@@ -87,7 +87,7 @@ If you find this book useful, please star (★) this repository or cite this boo
87
87
88
88
This open source book has benefited from pedagogical suggestions, typo corrections, and other improvements from community contributors. Your help is valuable for making the book better for everyone.
89
89
90
-
**Dear [D2L contributors](https://github.com/d2l-ai/d2l-en/graphs/contributors), please email your GitHub ID and name to d2lbook.en AT gmail DOT com so your name will appear on the [acknowledgments](https://d2l.ai/chapter_preface/index.html#Acknowledgments). Thanks.**
90
+
**Dear [D2L contributors](https://github.com/d2l-ai/d2l-en/graphs/contributors), please email your GitHub ID and name to d2lbook.en AT gmail DOT com so your name will appear on the [acknowledgments](https://d2l.ai/chapter_preface/index.html#acknowledgments). Thanks.**
0 commit comments