Skip to content

Commit 94cb6a3

Browse files
authored
Merge pull request #653 from jlin27/master
Add comment to clarify output_features for nn.Linear method
2 parents cbe12a7 + d9a9f91 commit 94cb6a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

beginner_source/transfer_learning_tutorial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ def visualize_model(model, num_images=6):
252252

253253
model_ft = models.resnet18(pretrained=True)
254254
num_ftrs = model_ft.fc.in_features
255+
# Here the size of each output sample is set to 2.
256+
# Alternatively, it can be generalized to nn.Linear(num_ftrs, len(class_names)).
255257
model_ft.fc = nn.Linear(num_ftrs, 2)
256258

257259
model_ft = model_ft.to(device)

0 commit comments

Comments
 (0)