Commit 10a69fbd authored by Laanait, Nouamane's avatar Laanait, Nouamane

moving hard coded final layer in YNet() to network_utils.py

parent b0dbdb48
Pipeline #81187 failed with stage
in 2 minutes and 21 seconds
......@@ -2787,18 +2787,18 @@ class YNet(FCDenseNet, FCNet):
# self._activation_summary(out)
# self._activation_image_summary(out)
with tf.variable_scope('%s_CONV_FIN' % subnet, reuse=self.reuse) as scope:
conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [3, 3], 'padding': 'SAME', 'features': 1})
self.print_verbose(">>> Adding CONV_FIN layer: ")
self.print_verbose(' input: %s' %format(out.get_shape().as_list()))
out, _ = self._conv(input=out, params=conv_1by1)
self.print_verbose(' output: %s' %format(out.get_shape().as_list()))
out_shape = out.get_shape().as_list()
self._print_layer_specs(layer_params, scope, in_shape, out_shape)
self.scopes.append(scope)
if self.summary:
self._activation_summary(out)
self._activation_image_summary(out)
# with tf.variable_scope('%s_CONV_FIN' % subnet, reuse=self.reuse) as scope:
# conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [3, 3], 'padding': 'SAME', 'features': 1})
# self.print_verbose(">>> Adding CONV_FIN layer: ")
# self.print_verbose(' input: %s' %format(out.get_shape().as_list()))
# out, _ = self._conv(input=out, params=conv_1by1)
# self.print_verbose(' output: %s' %format(out.get_shape().as_list()))
# out_shape = out.get_shape().as_list()
# self._print_layer_specs(layer_params, scope, in_shape, out_shape)
# self.scopes.append(scope)
# if self.summary:
# self._activation_summary(out)
# self._activation_image_summary(out)
self.model_output[subnet] = out
self.update_all_attrs(subnet=subnet)
self.print_rank('Total # of blocks: %d, weights: %2.1e, memory: %s MB, ops: %3.2e \n' % (len(network),
......
......@@ -437,10 +437,10 @@ def generate_YNet_json(save= True, out_dir='json_files', n_pool=3, n_layers_per_
rank += 1
features = features // 2
# 1x1 conv
# conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [1, 1], 'features': output_channels,
# 'activation': None, 'padding': 'SAME', 'batch_norm': False})
# layers_params_list.append(conv_1by1)
# layers_keys_list.append('CONV_FIN')
conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [3, 3], 'features': output_channels,
'activation': activation, 'padding': 'SAME', 'batch_norm': False})
layers_params_list.append(conv_1by1)
layers_keys_list.append('CONV_FIN')
model_keys.append('decoder_RE')
model_params.append(OrderedDict(zip(layers_keys_list, layers_params_list)))
......@@ -463,10 +463,10 @@ def generate_YNet_json(save= True, out_dir='json_files', n_pool=3, n_layers_per_
rank += 1
features = features // 2
# 1x1 conv
# conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [1, 1], 'features': output_channels,
# 'activation': None, 'padding': 'SAME', 'batch_norm': False})
# layers_params_list.append(conv_1by1)
# layers_keys_list.append('CONV_FIN')
conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [3, 3], 'features': output_channels,
'activation': activation, 'padding': 'SAME', 'batch_norm': False})
layers_params_list.append(conv_1by1)
layers_keys_list.append('CONV_FIN')
model_keys.append('decoder_IM')
model_params.append(OrderedDict(zip(layers_keys_list, layers_params_list)))
......@@ -498,10 +498,10 @@ def generate_YNet_json(save= True, out_dir='json_files', n_pool=3, n_layers_per_
features = features // 2
# 1x1 conv
# conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [1, 1], 'features': output_channels,
# 'activation': None, 'padding': 'SAME', 'batch_norm': False})
# layers_params_list.append(conv_1by1)
# layers_keys_list.append('CONV_FIN')
conv_1by1 = OrderedDict({'type': 'conv_2D', 'stride': [1, 1], 'kernel': [3, 3], 'features': output_channels,
'activation': activation, 'padding': 'SAME', 'batch_norm': False})
layers_params_list.append(conv_1by1)
layers_keys_list.append('CONV_FIN')
model_keys.append('inverter')
model_params.append(OrderedDict(zip(layers_keys_list, layers_params_list)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment