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
ModelZoo
ResNet50_tensorflow
Commits
17cec5c0
Commit
17cec5c0
authored
Mar 16, 2021
by
Dan Kondratyuk
Committed by
A. Unique TensorFlower
Mar 16, 2021
Browse files
Support arbitrary dimensions in stochastic depth.
PiperOrigin-RevId: 363188927
parent
8aae5ece
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
official/vision/beta/modeling/layers/nn_layers.py
official/vision/beta/modeling/layers/nn_layers.py
+1
-1
No files found.
official/vision/beta/modeling/layers/nn_layers.py
View file @
17cec5c0
...
@@ -232,7 +232,7 @@ class StochasticDepth(tf.keras.layers.Layer):
...
@@ -232,7 +232,7 @@ class StochasticDepth(tf.keras.layers.Layer):
batch_size
=
tf
.
shape
(
inputs
)[
0
]
batch_size
=
tf
.
shape
(
inputs
)[
0
]
random_tensor
=
keep_prob
random_tensor
=
keep_prob
random_tensor
+=
tf
.
random
.
uniform
(
random_tensor
+=
tf
.
random
.
uniform
(
[
batch_size
,
1
,
1
,
1
]
,
dtype
=
inputs
.
dtype
)
[
batch_size
]
+
[
1
]
*
(
inputs
.
shape
.
rank
-
1
)
,
dtype
=
inputs
.
dtype
)
binary_tensor
=
tf
.
floor
(
random_tensor
)
binary_tensor
=
tf
.
floor
(
random_tensor
)
output
=
tf
.
math
.
divide
(
inputs
,
keep_prob
)
*
binary_tensor
output
=
tf
.
math
.
divide
(
inputs
,
keep_prob
)
*
binary_tensor
return
output
return
output
...
...
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