tf_utils.py 文件源码

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

项目:lung-cancer-detector 作者: YichenGong 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号