@with_setup(setup, teardown)
def test_show_reconstructions():
 rows = 5
 cols = 10
 m = (rows * cols)
 model = show_reconstruct.load_model('dbm.pkl', m)
 dataset = show_reconstruct.load_dataset(model.dataset_yaml_src, use_test_set='n')
 batch = model.visible_layer.space.make_theano_batch()
 reconstruction = model.reconstruct(batch)
 recons_func = function([batch], reconstruction)
 vis_batch = dataset.get_batch_topo(m)
 patch_viewer = show_reconstruct.init_viewer(dataset, rows, cols, vis_batch)
 show_reconstruct.update_viewer(dataset, batch, rows, cols, patch_viewer, recons_func, vis_batch)

@ with_setup ( setup , teardown ) def test_show_reconstructions ( ) : rows = 5 cols = 10 m = ( rows * cols ) model = show_reconstruct . load_model ( 'dbm.pkl' , m ) dataset = show_reconstruct . load_dataset ( model . dataset_yaml_src , use_test_set = 'n' ) batch = model . visible_layer . space . make_theano_batch ( ) reconstruction = model . reconstruct ( batch ) recons_func = function ( [ batch ] , reconstruction ) vis_batch = dataset . get_batch_topo ( m ) patch_viewer = show_reconstruct . init_viewer ( dataset , rows , cols , vis_batch ) show_reconstruct . update_viewer ( dataset , batch , rows , cols , patch_viewer , recons_func , vis_batch )
test the reconstruction update_viewer function .