Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion 05_pytorch_going_modular.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,16 @@ data/

Once we've got data, we can then turn it into PyTorch `Dataset`'s and `DataLoader`'s (one for training data and one for testing data).

We convert the useful `Dataset` and `DataLoader` creation code into a function called `create_dataloaders()`.
First, we need to create the `going_modular` directory where we'll save all our Python scripts:

```python
import os

# Create the directory if it doesn't exist
os.makedirs('going_modular', exist_ok=True)
```

Now we can convert the useful `Dataset` and `DataLoader` creation code into a function called `create_dataloaders()`.

And we write it to file using the line `%%writefile going_modular/data_setup.py`.

Expand Down