Internal changes to tf.contrib symbols

PiperOrigin-RevId: 277929284
This commit is contained in:
Deepmind Team
2019-11-01 15:14:21 +00:00
committed by Diego de Las Casas
parent 9cf75990be
commit b308a9cd2b
+6 -5
View File
@@ -22,8 +22,10 @@ import functools
import sonnet as snt
import tensorflow as tf
from tensorflow.contrib import framework as contrib_framework
from tensorflow.contrib import layers as contrib_layers
nest = tf.contrib.framework.nest
nest = contrib_framework.nest
# Paper submission used BatchNorm, but we have since found that Layer & Instance
# norm can be quite a lot more stable.
@@ -189,7 +191,7 @@ class Encoder(snt.AbstractModule):
A tensor of features of shape [B, F_h, F_w, N] where F_h and F_w are the
height and width of the feature map and N = 4 * `self._filters`
"""
regularizers = {"w": tf.contrib.layers.l2_regularizer(1.0)}
regularizers = {"w": contrib_layers.l2_regularizer(1.0)}
features = image
for l in range(len(self._filters)):
@@ -257,7 +259,7 @@ class KeyPointer(snt.AbstractModule):
conv = snt.Conv2D(
self._num_keypoints, [1, 1],
stride=1,
regularizers={"w": tf.contrib.layers.l2_regularizer(1.0)},
regularizers={"w": contrib_layers.l2_regularizer(1.0)},
name="conv_1/conv_1")
image_features = self._keypoint_encoder(image, is_training=is_training)
@@ -400,7 +402,7 @@ class Decoder(snt.AbstractModule):
height, width = features.shape.as_list()[1:3]
filters = self._initial_filters
regularizers = {"w": tf.contrib.layers.l2_regularizer(1.0)}
regularizers = {"w": contrib_layers.l2_regularizer(1.0)}
layer = 0
@@ -458,4 +460,3 @@ class Decoder(snt.AbstractModule):
assert width == self._output_width
return features