Skip to content

Commit 0bd0bf0

Browse files
fchollettensorflower-gardener
authored andcommitted
Update tf.keras to the Keras 2.1.3 API.
PiperOrigin-RevId: 183328052
1 parent c2ea7a7 commit 0bd0bf0

116 files changed

Lines changed: 4870 additions & 1616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tensorflow/contrib/cmake/python_modules.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ tensorflow/python/grappler
3333
tensorflow/python/keras
3434
tensorflow/python/keras/activations
3535
tensorflow/python/keras/applications
36+
tensorflow/python/keras/applications/densenet
3637
tensorflow/python/keras/applications/inception_resnet_v2
3738
tensorflow/python/keras/applications/inception_v3
3839
tensorflow/python/keras/applications/mobilenet
40+
tensorflow/python/keras/applications/nasnet
3941
tensorflow/python/keras/applications/resnet50
4042
tensorflow/python/keras/applications/vgg16
4143
tensorflow/python/keras/applications/vgg19

tensorflow/python/keras/BUILD

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ py_library(
1414
"_impl/keras/__init__.py",
1515
"_impl/keras/activations.py",
1616
"_impl/keras/applications/__init__.py",
17+
"_impl/keras/applications/densenet.py",
1718
"_impl/keras/applications/imagenet_utils.py",
1819
"_impl/keras/applications/inception_resnet_v2.py",
1920
"_impl/keras/applications/inception_v3.py",
2021
"_impl/keras/applications/mobilenet.py",
22+
"_impl/keras/applications/nasnet.py",
2123
"_impl/keras/applications/resnet50.py",
2224
"_impl/keras/applications/vgg16.py",
2325
"_impl/keras/applications/vgg19.py",
@@ -76,9 +78,11 @@ py_library(
7678
"_impl/keras/wrappers/scikit_learn.py",
7779
"activations/__init__.py",
7880
"applications/__init__.py",
81+
"applications/densenet/__init__.py",
7982
"applications/inception_resnet_v2/__init__.py",
8083
"applications/inception_v3/__init__.py",
8184
"applications/mobilenet/__init__.py",
85+
"applications/nasnet/__init__.py",
8286
"applications/resnet50/__init__.py",
8387
"applications/vgg16/__init__.py",
8488
"applications/vgg19/__init__.py",
@@ -256,6 +260,18 @@ py_test(
256260
],
257261
)
258262

263+
py_test(
264+
name = "densenet_test",
265+
size = "large",
266+
srcs = ["_impl/keras/applications/densenet_test.py"],
267+
srcs_version = "PY2AND3",
268+
deps = [
269+
":keras",
270+
"//tensorflow/python:client_testlib",
271+
"//third_party/py/numpy",
272+
],
273+
)
274+
259275
py_test(
260276
name = "inception_resnet_v2_test",
261277
size = "medium",
@@ -292,6 +308,18 @@ py_test(
292308
],
293309
)
294310

311+
py_test(
312+
name = "nasnet_test",
313+
size = "large",
314+
srcs = ["_impl/keras/applications/nasnet_test.py"],
315+
srcs_version = "PY2AND3",
316+
deps = [
317+
":keras",
318+
"//tensorflow/python:client_testlib",
319+
"//third_party/py/numpy",
320+
],
321+
)
322+
295323
py_test(
296324
name = "resnet50_test",
297325
size = "small",
@@ -504,7 +532,7 @@ py_test(
504532

505533
py_test(
506534
name = "recurrent_test",
507-
size = "small",
535+
size = "medium",
508536
srcs = ["_impl/keras/layers/recurrent_test.py"],
509537
srcs_version = "PY2AND3",
510538
deps = [
@@ -527,7 +555,7 @@ py_test(
527555

528556
py_test(
529557
name = "wrappers_test",
530-
size = "small",
558+
size = "medium",
531559
srcs = ["_impl/keras/layers/wrappers_test.py"],
532560
srcs_version = "PY2AND3",
533561
tags = ["notsan"],

tensorflow/python/keras/_impl/keras/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
from tensorflow.python.keras._impl.keras.models import Model
4141
from tensorflow.python.keras._impl.keras.models import Sequential
4242

43-
__version__ = '2.1.2-tf'
43+
__version__ = '2.1.3-tf'

tensorflow/python/keras/_impl/keras/activations.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# ==============================================================================
15-
"""Keras built-in activation functions.
15+
"""Built-in activation functions.
1616
"""
1717
from __future__ import absolute_import
1818
from __future__ import division
@@ -61,10 +61,12 @@ def selu(x):
6161
x: A tensor or variable to compute the activation function for.
6262
6363
Returns:
64-
Tensor with the same shape and dtype as `x`.
64+
Tensor with the same shape and dtype as `x`.
65+
66+
# Note
67+
- To be used together with the initialization "lecun_normal".
68+
- To be used together with the dropout variant "AlphaDropout".
6569
66-
References:
67-
- [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515)
6870
"""
6971
alpha = 1.6732632423543772848170429916717
7072
scale = 1.0507009873554804934193349852946

tensorflow/python/keras/_impl/keras/applications/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
from __future__ import division
1919
from __future__ import print_function
2020

21+
from tensorflow.python.keras._impl.keras.applications.densenet import DenseNet121
22+
from tensorflow.python.keras._impl.keras.applications.densenet import DenseNet169
23+
from tensorflow.python.keras._impl.keras.applications.densenet import DenseNet201
2124
from tensorflow.python.keras._impl.keras.applications.inception_resnet_v2 import InceptionResNetV2
2225
from tensorflow.python.keras._impl.keras.applications.inception_v3 import InceptionV3
2326
from tensorflow.python.keras._impl.keras.applications.mobilenet import MobileNet
27+
from tensorflow.python.keras._impl.keras.applications.nasnet import NASNetLarge
28+
from tensorflow.python.keras._impl.keras.applications.nasnet import NASNetMobile
2429
from tensorflow.python.keras._impl.keras.applications.resnet50 import ResNet50
2530
from tensorflow.python.keras._impl.keras.applications.vgg16 import VGG16
2631
from tensorflow.python.keras._impl.keras.applications.vgg19 import VGG19

0 commit comments

Comments
 (0)