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
0944cb79
Commit
0944cb79
authored
Apr 22, 2022
by
Jaehong Kim
Committed by
A. Unique TensorFlower
Apr 22, 2022
Browse files
Internal change
PiperOrigin-RevId: 443706978
parent
828ed8b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
official/vision/modeling/backbones/spinenet_mobile.py
official/vision/modeling/backbones/spinenet_mobile.py
+8
-2
No files found.
official/vision/modeling/backbones/spinenet_mobile.py
View file @
0944cb79
...
...
@@ -365,15 +365,21 @@ class SpineNetMobile(tf.keras.Model):
parent_weights
=
[
tf
.
nn
.
relu
(
tf
.
cast
(
tf
.
Variable
(
1.0
,
name
=
'block{}_fusion{}'
.
format
(
i
,
j
)),
dtype
=
dtype
))
for
j
in
range
(
len
(
parents
))]
weights_sum
=
layers
.
Add
()(
parent_weights
)
weights_sum
=
parent_weights
[
0
]
for
adder
in
parent_weights
[
1
:]:
weights_sum
=
layers
.
Add
()([
weights_sum
,
adder
])
parents
=
[
parents
[
i
]
*
parent_weights
[
i
]
/
(
weights_sum
+
0.0001
)
for
i
in
range
(
len
(
parents
))
]
# Fuse all parent nodes then build a new block.
x
=
parents
[
0
]
for
adder
in
parents
[
1
:]:
x
=
layers
.
Add
()([
x
,
adder
])
x
=
tf_utils
.
get_activation
(
self
.
_activation
,
use_keras_layer
=
True
)(
layers
.
Add
()(
parents
)
)
self
.
_activation
,
use_keras_layer
=
True
)(
x
)
x
=
self
.
_block_group
(
inputs
=
x
,
in_filters
=
target_num_filters
,
...
...
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