# !say "Finished"
eval_complex_model(a)

save_model(a, "attempt_two/zero_models")

"""
Explanation: for d in ds[1:]:
    trainerer(a,d[:10], 1000,l_r = 0.006, batches= 5 )
trainerer(a,ds_three[:200], 1000,l_r = 0.002, batches= 1 )
End of explanation
"""


trainerer(a,ds_twos[:100], 10,l_r = 0.002, batches = 5)

vs = ContinuousSampler(a)
ds_twos[0].shape
pp.image(vs.reconstruction_given_visible(ds_twos[0].reshape(784)).reshape(28,28))

ds_all = np.vstack((ds))
        

from sklearn.neural_network import BernoulliRBM
model = BernoulliRBM(n_components=100, n_iter=40)
model.fit(rbmpy.datasets.flatten_data_set(ds_all))


eval_complex_model(rbmpy.rbm.create_from_sklearn_rbm(model, 784, ds_nine.shape[0]))

model


"""
Explanation: with open("models/bar_models", "rb") as f:
    a = pickle.load(f)
End of explanation
"""


