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]
评论列表
文章目录