We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3108ca4 commit a2d17b4Copy full SHA for a2d17b4
models/rbm.py
@@ -139,7 +139,11 @@ def get_reconstruction_cost(self):
139
reduce_activation_v_clip = tf.clip_by_value(1.0 - activation_v, clip_value_min=1e-30, clip_value_max=1.0)
140
cross_entropy = -tf.reduce_mean(tf.reduce_sum(self.input*(tf.log(activation_v_clip)) +
141
(1.0 - self.input)*(tf.log(reduce_activation_v_clip)), axis=1))
142
- return cross_entropy
+ return cross_entropy
143
+ def reconstruct(self, v):
144
+ """Reconstruct the original input by RBM"""
145
+ h = self.propup(v)
146
+ return self.propdown(h)
147
148
if __name__ == "__main__":
149
# mnist examples
0 commit comments