def compile(self, in_x, train_feed, eval_feed):
in_height, in_width, in_nchannels = self.in_d
nfilters, filter_len, stride, padding, param_init_fn = [dom[i]
for (dom, i) in zip(self.domains, self.chosen)]
# Creation and initialization of the parameters. Should take size of
# the filter into account.
W = tf.Variable(
param_init_fn( [filter_len, filter_len, in_nchannels, nfilters]) )
b = tf.Variable(tf.zeros([nfilters]))
# create the output and add the bias.
out_yaux = tf.nn.conv2d(in_x, W, strides=[1, stride, stride, 1], padding=padding)
out_y = tf.nn.bias_add(out_yaux, b)
#print(in_x.get_shape(), self.get_outdim(), out_y.get_shape())
return out_y
评论列表
文章目录