update formatting

This commit is contained in:
Daniel Bourke committed 2022-05-09 13:49:16 +10:00
1 parent 8bee60d472
commit 3557615ec6
1 file changed
+7 -7
+7 -7
View File
@@ -11,11 +11,11 @@ Afterwards we can reuse the same code in the scripts in the next notebook (06. T
Going modular involves turning notebook code (from a Jupyter Notebook or Google Colab notebook) into a series of different Python scripts that offer similar functionality.
For example, we'd turn our notebook code from a series of cells into the following files:
* `data_setup.py` - a file to prepare and download data if needed.
* `engine.py` - a file containing various training functions.
* `model_builder.py` or `model.py` - a file to create a PyTorch model.
* `train.py` - a file to leverage all other files and train a target PyTorch model.
* `utils.py` - a file dedicated to helpful utility functions.
- `data_setup.py` - a file to prepare and download data if needed.
- `engine.py` - a file containing various training functions.
- `model_builder.py` or `model.py` - a file to create a PyTorch model.
- `train.py` - a file to leverage all other files and train a target PyTorch model.
- `utils.py` - a file dedicated to helpful utility functions.
> **Note:** The naming and layout of the above files will depend on your use case and code requirements. Python scripts are as general as individual notebook cells, meaning, you could create one for almost any kind of functionality.
@@ -184,7 +184,7 @@ Getting the data in each of the 05 notebooks happens the same as in [notebook 04
A call is made to GitHub via Python's `requests` module to download a `.zip` file and unzip it.
```python
```python
import os
import requests
import zipfile
@@ -246,7 +246,7 @@ We convert the useful `Dataset` and `DataLoader` creation code into a function c
And we write it to file using the line `%%writefile going_modular/data_setup.py`.
```python
```py title="data_setup.py"
%%writefile going_modular/data_setup.py
"""
Contains functionality for creating PyTorch DataLoaders for