示例#1
0
 def avgpoolLayer(self, size, stride=None, pad='SAME'):
     self.result = L.avgpooling(self.result,
                                size,
                                stride,
                                'avgpool_' + str(self.layernum),
                                pad=pad)
     self.inpsize = self.result.get_shape().as_list()
     return self.result
示例#2
0
 def avgpoolLayer(self, size, pad='SAME', stride=None):
     if stride == None:
         stride = size
     self.result = L.avgpooling(self.result,
                                size,
                                stride,
                                'maxpool_' + str(self.layernum),
                                pad=pad)
     self.inpsize = self.result.get_shape().as_list()
     return [self.result, list(self.inpsize)]
 def avgpoolLayer(self, size, pad='SAME', stride=None):
     if stride == None:
         stride = size
     self.result = L.avgpooling(self.result,
                                size,
                                stride,
                                'maxpool_' + str(self.layernum),
                                pad=pad)
     if pad == 'VALID':
         self.inpsize[1] -= size - stride
         self.inpsize[2] -= size - stride
     self.inpsize[1] = self.inpsize[1] // stride
     self.inpsize[2] = self.inpsize[2] // stride
     return [self.result, list(self.inpsize)]