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
3a97b68c
Unverified
Commit
3a97b68c
authored
May 22, 2019
by
Toby Boyd
Committed by
GitHub
May 22, 2019
Browse files
fix lint issues. (#6855)
parent
85bdf764
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
official/transformer/utils/tokenizer.py
official/transformer/utils/tokenizer.py
+1
-1
official/transformer/v2/embedding_layer.py
official/transformer/v2/embedding_layer.py
+1
-0
official/transformer/v2/metrics.py
official/transformer/v2/metrics.py
+1
-2
official/transformer/v2/optimizer.py
official/transformer/v2/optimizer.py
+1
-2
No files found.
official/transformer/utils/tokenizer.py
View file @
3a97b68c
...
...
@@ -117,7 +117,7 @@ class Subtokenizer(object):
token_counts
,
alphabet
,
target_vocab_size
,
threshold
,
min_count
,
reserved_tokens
)
tf
.
compat
.
v1
.
logging
.
info
(
"Generated vocabulary with %d subtokens."
%
len
(
subtoken_list
))
len
(
subtoken_list
))
_save_vocab_file
(
vocab_file
,
subtoken_list
)
return
Subtokenizer
(
vocab_file
)
...
...
official/transformer/v2/embedding_layer.py
View file @
3a97b68c
...
...
@@ -36,6 +36,7 @@ class EmbeddingSharedWeights(tf.keras.layers.Layer):
self
.
hidden_size
=
hidden_size
def
build
(
self
,
input_shape
):
"""Build embedding layer."""
with
tf
.
name_scope
(
"embedding_and_softmax"
):
# Create and initialize weights. The random normal initializer was chosen
# arbitrarily, and works well.
...
...
official/transformer/v2/metrics.py
View file @
3a97b68c
...
...
@@ -22,7 +22,6 @@ Metrics:
- ROUGE score. Source:
https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/rouge.py
"""
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
...
...
@@ -150,7 +149,7 @@ class MetricLayer(tf.keras.layers.Layer):
(
tf
.
keras
.
metrics
.
Mean
(
"accuracy"
),
padded_accuracy
),
(
tf
.
keras
.
metrics
.
Mean
(
"accuracy_top5"
),
padded_accuracy_top5
),
(
tf
.
keras
.
metrics
.
Mean
(
"accuracy_per_sequence"
),
padded_sequence_accuracy
),
padded_sequence_accuracy
),
(
tf
.
keras
.
metrics
.
Mean
(
"neg_log_perplexity"
),
neg_log_perplexity
),
]
super
(
MetricLayer
,
self
).
build
(
input_shape
)
...
...
official/transformer/v2/optimizer.py
View file @
3a97b68c
...
...
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Optimizer from addons and learning rate scheduler.
"""
"""Optimizer from addons and learning rate scheduler."""
from
__future__
import
absolute_import
from
__future__
import
division
...
...
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