From 3557615ec697f13dc8cc1ef3c3a66e91e258567e Mon Sep 17 00:00:00 2001 From: Daniel Bourke Date: Mon, 9 May 2022 13:49:16 +1000 Subject: [PATCH] update formatting --- 05_pytorch_going_modular.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/05_pytorch_going_modular.md b/05_pytorch_going_modular.md index 3854434..c3373e2 100644 --- a/05_pytorch_going_modular.md +++ b/05_pytorch_going_modular.md @@ -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