def fc_drop_bn_relu(inp, inp_size, out_size, prob=1.0, name="", is_train=True):
weights = tf.Variable(tf.truncated_normal(
shape=[inp_size, out_size],
mean=0.0,
stddev=0.3),
name=name+"_weights")
bias = tf.Variable(tf.constant(
shape=[out_size],
value=0.0),
name=name+"_bias")
out = tf.nn.relu(
tf.contrib.layers.batch_norm(
tf.nn.dropout(
tf.matmul(inp, weights) + bias,
prob, name=name+"_drop"), is_training=is_train))
return out, weights, bias
评论列表
文章目录