#Instruction for data loading #Other testing data contained in the file, but not used in the example, can be loaded as follow: import h5py def load_dataset(file_location,what_to_load): hf = h5py.File( file_location , 'r') fl = hf[what_to_load] Rarray = np.array(fl) hf.close() return Rarray #Insert location file_location = '' ### Testing data Who = ['horse', 'cat', 'parrot','punch'] original_dict = {} speckle_dict = {} test_dict = {} pred_dict = {} for elm in Who: # Original Images to_load = 'Testing/Original_images/' + elm original_dict[elm] = load_dataset(file_location, to_load) # Speckle Patterns to_load = 'Testing/Speckle_images/' + elm speckle_dict[elm] = load_dataset(file_location, to_load) test_dict[elm] = real_to_channels_np(speckle_dict[elm].astype('float32')) #### PREDICTION for elm in Who: pred_dict[elm] = model.predict(test_dict[elm]) **2 pred_dict[elm] = pred_dict[elm].reshape(pred_dict[elm].shape[0], orig_dim, orig_dim) ### So that pred_dict[elm] will be compared to original_dict[elm]**2