crbm.py 文件源码

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

项目:CDBN-for-Tensorflow 作者: shygiants 项目源码 文件源码
def __declare_variables(self):
        # Bias variables
        self.bias = self.__bias_variables([self.num_features], 'bias')
        self.cias = self.__bias_variables([self.depth], 'cias')

        # Visible (input) units
        with tf.name_scope('visible') as _:
            self.x = self._input if self._input is not None \
                else tf.placeholder(tf.float32, shape=self.input_shape, name='x')
            self.vis_0 = tf.div(self.x, 255, 'vis_0')

        # Weight variables
        with tf.name_scope('weights') as _:
            self.weights = self.__weight_variable(self.weight_shape, 'weights_forward')
            self.weights_flipped = tf.transpose(
                tf.reverse(self.weights, [True, True, False, False]), perm=[0, 1, 3, 2], name='weight_back')

        self.variables = [self.bias, self.cias, self.weights]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号