ops.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:mann-for-speech-separation 作者: KWTsou1220 项目源码 文件源码
def conv_layer(input_, filter_shape, stride_shape=[1, 1, 1, 1], padding='SAME', name=None):
    """
    Args:
        input_: a 4D Tensor of size [batch_size x height x width x channel]
        filter_shape: desired filter size [height, width, in_ch, out_ch]
        stride_shape: desired stride size [1, stride_h, stride_w, 1]
        padding: "SAME" or "VALID"
    """
    input_shape = input_.get_shape()
    with vs.variable_scope(name or "conv"):
        initializer = tf.contrib.layers.xavier_initializer_conv2d(uniform=True, seed=None, dtype=tf.float32)
        W = _weight_variable(shape=filter_shape, initializer=initializer)
        b = _bias_variable(shape=[filter_shape[3],])
        y = tf.nn.conv2d(input_, filter=W, strides=stride_shape, padding=padding)
        y = tf.nn.bias_add(y, b)
    return y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号