Skip to content

Commit 78188fd

Browse files
committed
Various fixes
1 parent b7c526b commit 78188fd

File tree

1 file changed

+4
-4
lines changed
  • pytorch_tutorial/convolutional_neural_network

1 file changed

+4
-4
lines changed

pytorch_tutorial/convolutional_neural_network/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ DATA_DIR = "./_output"
6666
# Download and construct the Fashion-MNIST images dataset
6767
# The training set is used to train the model
6868
train_dataset = datasets.FashionMNIST(
69-
root=f"DATA_DIR",
69+
root=DATA_DIR,
7070
train=True, # Training set
7171
download=True,
7272
transform=transforms.ToTensor(),
7373
)
7474
# The test set is used to evaluate the trained model performance on unseen data
7575
test_dataset = datasets.FashionMNIST(
76-
root=f"DATA_DIR",
76+
root=DATA_DIR,
7777
train=False, # Test set
7878
download=True,
7979
transform=transforms.ToTensor(),
@@ -111,14 +111,14 @@ print(f"{n_train_samples} training samples, {n_test_samples} test samples")
111111

112112
### PyTorch models as classes
113113

114-
Non-trivial PyTorch models are created as subclasses of the [Module]() class. Two elements must be included into a model class:
114+
Most non-trivial PyTorch models are created as subclasses of the [Module](https://pytorch.org/docs/stable/generated/torch.nn.Module.html) class. Two elements must be included into a model class:
115115

116116
- the constructor (`__init__()` function) to define the model architecture;
117117
- the `forward()` function to implement the forward pass of input data through the model.
118118

119119
### Model architecture
120120

121-
We design a basic convolutional network. It takes a tensor of shape `(1, 28, 28)` (a rescaled grayscale image) as input and applies 2D convolution and max-pooling operations to detect interesting features. The output of these operations is flattened into a vector of shape and passes through two linear layers to compute 10 values, one for each possible class.
121+
We design a basic convolutional network. It takes a tensor of shape `(1, 28, 28)` (a rescaled grayscale image) as input and applies 2D convolution and max-pooling operations to detect interesting features. The output of these operations is flattened into a vector and passes through two linear layers (also called *dense* of *fully connected* layers) to compute 10 values, one for each possible class.
122122

123123
![Fashion-MNIST convet architecture](images/fashionnet.png)
124124

0 commit comments

Comments
 (0)