Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
1f085a0e
Commit
1f085a0e
authored
Mar 28, 2017
by
Karan Dwivedi
Committed by
Soumith Chintala
Mar 27, 2017
Browse files
Add num_classes (#128)
parent
74d04d2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/models/vgg.py
torchvision/models/vgg.py
+2
-2
No files found.
torchvision/models/vgg.py
View file @
1f085a0e
...
@@ -19,7 +19,7 @@ model_urls = {
...
@@ -19,7 +19,7 @@ model_urls = {
class
VGG
(
nn
.
Module
):
class
VGG
(
nn
.
Module
):
def
__init__
(
self
,
features
):
def
__init__
(
self
,
features
,
num_classes
=
1000
):
super
(
VGG
,
self
).
__init__
()
super
(
VGG
,
self
).
__init__
()
self
.
features
=
features
self
.
features
=
features
self
.
classifier
=
nn
.
Sequential
(
self
.
classifier
=
nn
.
Sequential
(
...
@@ -29,7 +29,7 @@ class VGG(nn.Module):
...
@@ -29,7 +29,7 @@ class VGG(nn.Module):
nn
.
Linear
(
4096
,
4096
),
nn
.
Linear
(
4096
,
4096
),
nn
.
ReLU
(
True
),
nn
.
ReLU
(
True
),
nn
.
Dropout
(),
nn
.
Dropout
(),
nn
.
Linear
(
4096
,
1000
),
nn
.
Linear
(
4096
,
num_classes
),
)
)
self
.
_initialize_weights
()
self
.
_initialize_weights
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment