コード例 #1
0
	def deconvLayer(self,kernel,outchn,stride=1,pad='SAME',activation=-1,batch_norm=False):
		self.result = L.deconv2D(self.result,kernel,outchn,'deconv_'+str(self.layernum),stride=stride,pad=pad)
		if batch_norm:
			self.result = L.batch_norm(self.result,'batch_norm_'+str(self.layernum),training=self.bntraining,epsilon=self.epsilon)
		self.layernum+=1
		self.inpsize = self.result.get_shape().as_list()
		self.activate(activation)
		return self.result
コード例 #2
0
 def deconvLayer(self,
                 kernel,
                 outchn,
                 stride=1,
                 pad='SAME',
                 activation=-1,
                 batch_norm=False):
     self.result = L.deconv2D(self.result,
                              kernel,
                              outchn,
                              'deconv_' + str(self.layernum),
                              stride=stride,
                              pad=pad)
     if batch_norm:
         self.result = L.batch_norm(self.result,
                                    'batch_norm_' + str(self.layernum))
     self.layernum += 1
     self.inpsize[1] *= stride
     self.inpsize[2] *= stride
     self.inpsize[3] = outchn
     self.activate(activation)
     return [self.result, list(self.inpsize)]