Adde strides to the pooling issue #12

parent 6d4910cc
......@@ -10,12 +10,13 @@ from .Layer import Layer
class MaxPooling(Layer):
def __init__(self, name, shape=[1, 2, 2, 1], activation=None):
def __init__(self, name, shape=[1, 2, 2, 1], strides=[1, 1, 1, 1], activation=None):
"""
Constructor
"""
super(MaxPooling, self).__init__(name, use_gpu=False, activation=activation)
self.shape = shape
self.strides = strides
def create_variables(self, input_layer):
self.input_layer = input_layer
......@@ -23,7 +24,7 @@ class MaxPooling(Layer):
def get_graph(self):
with tf.name_scope(str(self.name)):
output = tf.nn.max_pool(self.input_layer, ksize=self.shape, strides=[1, 1, 1, 1], padding='SAME')
output = tf.nn.max_pool(self.input_layer, ksize=self.shape, strides=self.strides, padding='SAME')
if self.activation is not None:
output = self.activation(output)
......
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