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
5a898973
Commit
5a898973
authored
Mar 09, 2021
by
Frederick Liu
Committed by
A. Unique TensorFlower
Mar 09, 2021
Browse files
Internal change
PiperOrigin-RevId: 361957289
parent
7e3d5270
Changes
267
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
52 additions
and
47 deletions
+52
-47
official/nlp/modeling/networks/span_labeling_test.py
official/nlp/modeling/networks/span_labeling_test.py
+2
-2
official/nlp/modeling/networks/xlnet_base.py
official/nlp/modeling/networks/xlnet_base.py
+2
-3
official/nlp/modeling/networks/xlnet_base_test.py
official/nlp/modeling/networks/xlnet_base_test.py
+2
-5
official/nlp/modeling/ops/__init__.py
official/nlp/modeling/ops/__init__.py
+1
-1
official/nlp/modeling/ops/beam_search.py
official/nlp/modeling/ops/beam_search.py
+2
-2
official/nlp/modeling/ops/beam_search_test.py
official/nlp/modeling/ops/beam_search_test.py
+2
-2
official/nlp/modeling/ops/decoding_module.py
official/nlp/modeling/ops/decoding_module.py
+2
-2
official/nlp/modeling/ops/decoding_module_test.py
official/nlp/modeling/ops/decoding_module_test.py
+2
-2
official/nlp/modeling/ops/sampling_module.py
official/nlp/modeling/ops/sampling_module.py
+2
-2
official/nlp/modeling/ops/segment_extractor.py
official/nlp/modeling/ops/segment_extractor.py
+1
-3
official/nlp/modeling/ops/segment_extractor_test.py
official/nlp/modeling/ops/segment_extractor_test.py
+1
-3
official/nlp/nhnet/__init__.py
official/nlp/nhnet/__init__.py
+14
-0
official/nlp/nhnet/configs.py
official/nlp/nhnet/configs.py
+2
-3
official/nlp/nhnet/configs_test.py
official/nlp/nhnet/configs_test.py
+2
-2
official/nlp/nhnet/decoder.py
official/nlp/nhnet/decoder.py
+2
-2
official/nlp/nhnet/decoder_test.py
official/nlp/nhnet/decoder_test.py
+2
-2
official/nlp/nhnet/evaluation.py
official/nlp/nhnet/evaluation.py
+2
-3
official/nlp/nhnet/input_pipeline.py
official/nlp/nhnet/input_pipeline.py
+2
-2
official/nlp/nhnet/models.py
official/nlp/nhnet/models.py
+5
-4
official/nlp/nhnet/models_test.py
official/nlp/nhnet/models_test.py
+2
-2
No files found.
official/nlp/modeling/networks/span_labeling_test.py
View file @
5a898973
# Copyright 201
9
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for span_labeling network."""
import
numpy
as
np
import
tensorflow
as
tf
...
...
official/nlp/modeling/networks/xlnet_base.py
View file @
5a898973
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -12,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Keras-based XLNet Model."""
from
absl
import
logging
...
...
official/nlp/modeling/networks/xlnet_base_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,11 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
"""Tests for Keras based XLNet model."""
import
numpy
as
np
import
tensorflow
as
tf
...
...
official/nlp/modeling/ops/__init__.py
View file @
5a898973
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Ops package definition."""
from
official.nlp.modeling.ops.beam_search
import
sequence_beam_search
from
official.nlp.modeling.ops.segment_extractor
import
get_next_sentence_labels
...
...
official/nlp/modeling/ops/beam_search.py
View file @
5a898973
# Copyright 201
8
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Beam search to find the translated sequence with the highest probability."""
import
numpy
as
np
...
...
official/nlp/modeling/ops/beam_search_test.py
View file @
5a898973
# Copyright 201
8
The TensorFlow Authors. All Rights Reserved.
# Copyright 20
2
1 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test beam search helper methods."""
from
absl.testing
import
parameterized
...
...
official/nlp/modeling/ops/decoding_module.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Base class for Decoding Strategies (beam_search, top_k, top_p and greedy)."""
import
abc
...
...
official/nlp/modeling/ops/decoding_module_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test decoding utility methods."""
import
abc
...
...
official/nlp/modeling/ops/sampling_module.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Sampling module for top_k, top_p and greedy decoding."""
import
abc
...
...
official/nlp/modeling/ops/segment_extractor.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,9 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Lint as: python3
"""Module for extracting segments from sentences in documents."""
import
tensorflow
as
tf
...
...
official/nlp/modeling/ops/segment_extractor_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,10 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# encoding=utf-8
# Lint as: python3
"""Tests for sentence prediction labels."""
import
functools
...
...
official/nlp/nhnet/__init__.py
View file @
5a898973
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
official/nlp/nhnet/configs.py
View file @
5a898973
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -12,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Common NHNet/Bert2Bert configuration."""
from
typing
import
List
,
Text
...
...
official/nlp/nhnet/configs_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for configs."""
import
tensorflow
as
tf
...
...
official/nlp/nhnet/decoder.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Transformer decoder that mimics a BERT encoder, to load BERT checkpoints."""
import
tensorflow
as
tf
...
...
official/nlp/nhnet/decoder_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for nlp.nhnet.decoder."""
import
numpy
as
np
...
...
official/nlp/nhnet/evaluation.py
View file @
5a898973
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -12,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Evaluation for Bert2Bert."""
import
os
...
...
official/nlp/nhnet/input_pipeline.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Input pipelines."""
import
tensorflow
as
tf
...
...
official/nlp/nhnet/models.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,21 +11,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""tf.keras Models for NHNet."""
from
typing
import
Optional
,
Text
from
absl
import
logging
import
gin
import
tensorflow
as
tf
from
typing
import
Optional
,
Text
from
official.modeling
import
tf_utils
from
official.modeling.hyperparams
import
params_dict
from
official.nlp.modeling
import
networks
from
official.nlp.modeling.layers
import
multi_channel_attention
from
official.nlp.modeling.ops
import
beam_search
from
official.nlp.nhnet
import
configs
from
official.nlp.nhnet
import
decoder
from
official.nlp.nhnet
import
utils
from
official.nlp.modeling.ops
import
beam_search
def
embedding_linear
(
embedding_matrix
,
x
):
...
...
official/nlp/nhnet/models_test.py
View file @
5a898973
# Copyright 202
0
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for nlp.nhnet.models."""
import
os
...
...
Prev
1
…
5
6
7
8
9
10
11
12
13
14
Next
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