Skip to content

Commit 21f4bce

Browse files
Merge pull request #54 from SunnyNagam/patch-1
Fixed inconsistant use of filters by implementing 'self.gf'
2 parents c45c924 + 0c0888e commit 21f4bce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

srgan/srgan.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ def build_vgg(self):
117117

118118
def build_generator(self):
119119

120-
def residual_block(layer_input):
120+
def residual_block(layer_input, filters):
121121
"""Residual block described in paper"""
122-
d = Conv2D(64, kernel_size=3, strides=1, padding='same')(layer_input)
122+
d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(layer_input)
123123
d = Activation('relu')(d)
124124
d = BatchNormalization(momentum=0.8)(d)
125-
d = Conv2D(64, kernel_size=3, strides=1, padding='same')(d)
125+
d = Conv2D(filters, kernel_size=3, strides=1, padding='same')(d)
126126
d = BatchNormalization(momentum=0.8)(d)
127127
d = Add()([d, layer_input])
128128
return d
@@ -144,7 +144,7 @@ def deconv2d(layer_input):
144144
# Propogate through residual blocks
145145
r = residual_block(c1)
146146
for _ in range(self.n_residual_blocks - 1):
147-
r = residual_block(r)
147+
r = residual_block(r, self.gf)
148148

149149
# Post-residual block
150150
c2 = Conv2D(64, kernel_size=3, strides=1, padding='same')(r)

0 commit comments

Comments
 (0)