def image_processing_layers(self) -> List[tf.Tensor]:
"""Do all convolutions and return the last conditional map.
Applies convolutions on the input tensor with optional max pooling.
All the intermediate layers are stored in the `image_processing_layers`
attribute. There is not dropout between the convolutional layers, by
default the activation function is ReLU.
"""
last_layer = self.image_input
image_processing_layers = [] # type: List[tf.Tensor]
with tf.variable_scope("convolutions"):
for i, (filter_size,
n_filters,
pool_size) in enumerate(self.convolutions):
with tf.variable_scope("cnn_layer_{}".format(i)):
last_layer = conv2d(last_layer, n_filters, filter_size)
image_processing_layers.append(last_layer)
if pool_size:
last_layer = max_pool2d(last_layer, pool_size)
image_processing_layers.append(last_layer)
return image_processing_layers
评论列表
文章目录