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: pytorch_tutorial/convolutional_neural_network/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -66,14 +66,14 @@ DATA_DIR = "./_output"
66
66
# Download and construct the Fashion-MNIST images dataset
67
67
# The training set is used to train the model
68
68
train_dataset = datasets.FashionMNIST(
69
-
root=f"DATA_DIR",
69
+
root=DATA_DIR,
70
70
train=True, # Training set
71
71
download=True,
72
72
transform=transforms.ToTensor(),
73
73
)
74
74
# The test set is used to evaluate the trained model performance on unseen data
75
75
test_dataset = datasets.FashionMNIST(
76
-
root=f"DATA_DIR",
76
+
root=DATA_DIR,
77
77
train=False, # Test set
78
78
download=True,
79
79
transform=transforms.ToTensor(),
@@ -111,14 +111,14 @@ print(f"{n_train_samples} training samples, {n_test_samples} test samples")
111
111
112
112
### PyTorch models as classes
113
113
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:
115
115
116
116
- the constructor (`__init__()` function) to define the model architecture;
117
117
- the `forward()` function to implement the forward pass of input data through the model.
118
118
119
119
### Model architecture
120
120
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.
0 commit comments