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
6f2f9213
Commit
6f2f9213
authored
Mar 29, 2019
by
Michael Kösel
Committed by
Soumith Chintala
Mar 29, 2019
Browse files
update code (#824)
parent
67c29f8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
torchvision/models/inception.py
torchvision/models/inception.py
+3
-2
No files found.
torchvision/models/inception.py
View file @
6f2f9213
...
...
@@ -67,9 +67,10 @@ class Inception3(nn.Module):
import
scipy.stats
as
stats
stddev
=
m
.
stddev
if
hasattr
(
m
,
'stddev'
)
else
0.1
X
=
stats
.
truncnorm
(
-
2
,
2
,
scale
=
stddev
)
values
=
torch
.
T
ensor
(
X
.
rvs
(
m
.
weight
.
numel
()))
values
=
torch
.
as_t
ensor
(
X
.
rvs
(
m
.
weight
.
numel
())
,
dtype
=
m
.
weight
.
dtype
)
values
=
values
.
view
(
m
.
weight
.
size
())
m
.
weight
.
data
.
copy_
(
values
)
with
torch
.
no_grad
():
m
.
weight
.
copy_
(
values
)
elif
isinstance
(
m
,
nn
.
BatchNorm2d
):
nn
.
init
.
constant_
(
m
.
weight
,
1
)
nn
.
init
.
constant_
(
m
.
bias
,
0
)
...
...
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