yell / boltzmann-machines

Boltzmann Machines in TensorFlow with examples
MIT License
849 stars 135 forks source link

reconstruct #16

Open AvocadoAlpha opened 5 years ago

AvocadoAlpha commented 5 years ago

I am looking for something equivalent to model.predict(X_test) in keras.

res = dbm.reconstruct(X_test)

Traceback (most recent call last): File "/home/yunus/PycharmProjects/boltz_/boltzmann-machines-clone/examples/dbmmnist.py", line 402, in main() File "/home/yunus/PycharmProjects/boltz/boltzmann-machines-clone/examples/dbm_mnist.py", line 377, in main res = dbm.reconstruct(Xtest) File "/home/yunus/PycharmProjects/boltz/boltzmann-machines-clone/boltzmann_machines/base/tf_model.py", line 28, in wrappedf res = f(model, *args, **kwargs) File "/home/yunus/PycharmProjects/boltz/boltzmann-machines-clone/boltzmann_machines/dbm.py", line 877, in reconstruct self._reconstruction = tf.get_collection('reconstruction')[0] IndexError: list index out of range

tf.get_collection('reconstruction') returns an empty list.

when i run dummy2 = tf.get_default_graph().get_all_collection_keys() there is no reconstruction entry.

reconstruct is the equivalent i thought but i cant get it to work. Is there a reconstruct for RBM or how is it called?

AvocadoAlpha commented 5 years ago

so this can be solved by training the model on your own machine. reconstruct then works. Nevertheless one open question what is the equivalent reconstruct method for rbm ? Thanks!!