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
a1a7aaca
Commit
a1a7aaca
authored
Aug 25, 2020
by
A. Unique TensorFlower
Browse files
Get the handle of self._embedding_norm_layer for future weight copying.
PiperOrigin-RevId: 328389991
parent
a0b4cdb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
official/nlp/modeling/networks/encoder_scaffold.py
official/nlp/modeling/networks/encoder_scaffold.py
+8
-6
No files found.
official/nlp/modeling/networks/encoder_scaffold.py
View file @
a1a7aaca
...
@@ -163,12 +163,14 @@ class EncoderScaffold(tf.keras.Model):
...
@@ -163,12 +163,14 @@ class EncoderScaffold(tf.keras.Model):
embeddings
=
tf
.
keras
.
layers
.
Add
()(
embeddings
=
tf
.
keras
.
layers
.
Add
()(
[
word_embeddings
,
position_embeddings
,
type_embeddings
])
[
word_embeddings
,
position_embeddings
,
type_embeddings
])
embeddings
=
(
tf
.
keras
.
layers
.
LayerNormalization
(
self
.
_embedding_norm_layer
=
tf
.
keras
.
layers
.
LayerNormalization
(
name
=
'embeddings/layer_norm'
,
name
=
'embeddings/layer_norm'
,
axis
=-
1
,
axis
=-
1
,
epsilon
=
1e-12
,
epsilon
=
1e-12
,
dtype
=
tf
.
float32
)(
embeddings
))
dtype
=
tf
.
float32
)
embeddings
=
self
.
_embedding_norm_layer
(
embeddings
)
embeddings
=
(
embeddings
=
(
tf
.
keras
.
layers
.
Dropout
(
tf
.
keras
.
layers
.
Dropout
(
rate
=
embedding_cfg
[
'dropout_rate'
])(
embeddings
))
rate
=
embedding_cfg
[
'dropout_rate'
])(
embeddings
))
...
...
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