@@ -170,15 +170,24 @@ class Convolution(Layer):
170170 but for `valid` (default) it will be smaller or equal.
171171
172172 pool_shape: tuple of ints, optional
173- A two-dimensional tuple of integers corresponding to the pool size. This should be
174- square, for example `(2,2)` to reduce the size by half, or `(4,4)` to make the output
175- a quarter of the original.
173+ A two-dimensional tuple of integers corresponding to the pool size for downsampling.
174+ This should be square, for example `(2,2)` to reduce the size by half, or `(4,4)` to make
175+ the output a quarter of the original.
176+
177+ Pooling is applied after the convolution and calculation of its activation.
176178
177179 pool_type: str, optional
178180 Type of the pooling to be used; can be either `max` or `mean`. If a `pool_shape` is
179181 specified the default is to take the maximum value of all inputs that fall into this
180182 pool. Otherwise, the default is None and no pooling is used for performance.
181183
184+ scale_factor: tuple of ints, optional
185+ A two-dimensional tuple of integers corresponding to upscaling ration. This should be
186+ square, for example `(2,2)` to increase the size by double, or `(4,4)` to make the
187+ output four times the original.
188+
189+ Upscaling is applied after the convolution and calculation of its activation.
190+
182191 weight_decay: float, optional
183192 The coefficient for L1 or L2 regularization of the weights. For example, a value of
184193 0.0001 is multiplied by the L1 or L2 weight decay equation.
@@ -208,6 +217,7 @@ def __init__(
208217 border_mode = 'valid' ,
209218 pool_shape = None ,
210219 pool_type = None ,
220+ scale_factor = None ,
211221 weight_decay = None ,
212222 dropout = None ,
213223 frozen = False ):
@@ -229,11 +239,12 @@ def __init__(
229239 frozen = frozen )
230240
231241 self .channels = channels
232- self .pool_shape = pool_shape or (1 ,1 )
233- self .pool_type = pool_type or ('max' if pool_shape else None )
234242 self .kernel_shape = kernel_shape
235243 self .kernel_stride = kernel_stride or (1 ,1 )
236244 self .border_mode = border_mode
245+ self .pool_shape = pool_shape or (1 ,1 )
246+ self .pool_type = pool_type or ('max' if pool_shape else None )
247+ self .scale_factor = scale_factor or (1 ,1 )
237248
238249
239250class NeuralNetwork (object ):
0 commit comments