Skip to content

Commit

Permalink
Concatenating U-Net layers instead of summing. #4
Browse files Browse the repository at this point in the history
  • Loading branch information
costapt committed Apr 10, 2017
1 parent 50ef3cc commit 5702175
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def concatenate_layers(inputs, concat_axis, mode='concat'):
assert mode == 'concat', "Only concatenation is supported in this wrapper"
return Concatenate(axis=concat_axis)(inputs)
else:
return merge(inputs=inputs, concat_axis=concat_axis)
return merge(inputs=inputs, concat_axis=concat_axis, mode=mode)


def Convolution(f, k=3, s=2, border_mode='same', **kwargs):
Expand Down Expand Up @@ -393,7 +393,7 @@ def get_deconv_shape(samples, channels, x_dim, y_dim):
raise ValueError(
'Keras dimension ordering not supported: {}'.format(
K.image_dim_ordering()))

# in_ch x 512 x 512
conv1 = Convolution(nf)(i)
conv1 = BatchNorm()(conv1)
Expand Down Expand Up @@ -445,9 +445,9 @@ def get_deconv_shape(samples, channels, x_dim, y_dim):
k=2, s=1)(x)
dconv1 = BatchNorm()(dconv1)
dconv1 = Dropout(0.5)(dconv1)

x = concatenate_layers([dconv1, conv8], **merge_params)

x = LeakyReLU(0.2)(x)
# nf*(8 + 8) x 2 x 2

Expand Down

0 comments on commit 5702175

Please sign in to comment.