def get_output(self, input, **kwargs):
var_shape = kwargs.get('var_shape', False)
if var_shape:
input_shape = None
else:
input_shape = self.input_shape
lin_output = conv2d(
input=input,
filters=self.W,
filter_shape=self.filter_shape,
border_mode=self.mode,
subsample=self.subsample,
input_shape=input_shape
)
if self.batch_norm:
lin_output = self.bn_layer.get_output(lin_output)
elif not self.no_bias:
lin_output += self.b.dimshuffle('x', 0, 'x', 'x')
return self.activation(lin_output)
评论列表
文章目录