convNet.py 文件源码

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

项目:adascan_public 作者: amlankar 项目源码 文件源码
def fc_layer(self, bottom, name):
        with tf.variable_scope(name) as scope:
            shape = bottom.get_shape().as_list()
            dim = 1
            for d in shape[1:]:
                dim *= d
            x = tf.reshape(bottom, [-1, dim])

            with tf.device('/cpu:0'):
                weights = self.get_fc_weight(name)
                biases = self.get_fc_bias(name)

            # Fully connected layer. Note that the '+' operation automatically
            # broadcasts the biases.
            fc = tf.nn.bias_add(tf.matmul(x, weights), biases)
            #tf.histogram_summary('adascan/'+name+'_activations', fc)
            #tf.histogram_summary('adascan/'+name+'_weights', weights)
            scope.reuse_variables()
            return fc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号