tuple_rect.py 文件源码

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

项目:failures_of_DL 作者: shakedshammah 项目源码 文件源码
def Affine(name_scope,input_tensor,out_channels, relu=True):
    input_shape = input_tensor.get_shape().as_list()
    input_channels = input_shape[-1]
    with tf.name_scope(name_scope):
        weights = tf.Variable(
            tf.truncated_normal([input_channels, out_channels],
                                stddev=1.0 / math.sqrt(float(input_channels))),name='weights')
        biases = tf.Variable(tf.zeros([out_channels]),name='biases')
#         initializer = tf.initialize_variables([weights,biases])
        if relu: return tf.nn.relu(tf.matmul(input_tensor, weights) + biases)#,initializer
        else: return tf.matmul(input_tensor, weights) + biases#,initializer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号