mirror of
https://github.com/google-deepmind/deepmind-research.git
synced 2026-05-10 05:17:46 +08:00
Internal changes to tf.contrib symbols
PiperOrigin-RevId: 277929284
This commit is contained in:
committed by
Diego de Las Casas
parent
9cf75990be
commit
b308a9cd2b
@@ -22,8 +22,10 @@ import functools
|
|||||||
|
|
||||||
import sonnet as snt
|
import sonnet as snt
|
||||||
import tensorflow as tf
|
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
|
# Paper submission used BatchNorm, but we have since found that Layer & Instance
|
||||||
# norm can be quite a lot more stable.
|
# 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
|
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`
|
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
|
features = image
|
||||||
for l in range(len(self._filters)):
|
for l in range(len(self._filters)):
|
||||||
@@ -257,7 +259,7 @@ class KeyPointer(snt.AbstractModule):
|
|||||||
conv = snt.Conv2D(
|
conv = snt.Conv2D(
|
||||||
self._num_keypoints, [1, 1],
|
self._num_keypoints, [1, 1],
|
||||||
stride=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")
|
name="conv_1/conv_1")
|
||||||
|
|
||||||
image_features = self._keypoint_encoder(image, is_training=is_training)
|
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]
|
height, width = features.shape.as_list()[1:3]
|
||||||
|
|
||||||
filters = self._initial_filters
|
filters = self._initial_filters
|
||||||
regularizers = {"w": tf.contrib.layers.l2_regularizer(1.0)}
|
regularizers = {"w": contrib_layers.l2_regularizer(1.0)}
|
||||||
|
|
||||||
layer = 0
|
layer = 0
|
||||||
|
|
||||||
@@ -458,4 +460,3 @@ class Decoder(snt.AbstractModule):
|
|||||||
assert width == self._output_width
|
assert width == self._output_width
|
||||||
|
|
||||||
return features
|
return features
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user