def test_hdf5_load_all():
 skip_if_no_h5py()
 import h5py
 (handle, filename) = tempfile.mkstemp()
 dataset = random_one_hot_dense_design_matrix(np.random.RandomState(1), num_examples=10, dim=5, num_classes=3)
 with h5py.File(filename, 'w') as f:
  f.create_dataset('X', data=dataset.get_design_matrix())
  f.create_dataset('y', data=dataset.get_targets())
 trainer = yaml_parse.load((load_all_yaml % {'filename': filename}))
 trainer.main_loop()
 os.remove(filename)

def test_hdf5_load_all ( ) : skip_if_no_h5py ( ) import h5py ( handle , filename ) = tempfile . mkstemp ( ) dataset = random_one_hot_dense_design_matrix ( np . random . RandomState ( 1 ) , num_examples = 10 , dim = 5 , num_classes = 3 ) with h5py . File ( filename , 'w' ) as f : f . create_dataset ( 'X' , data = dataset . get_design_matrix ( ) ) f . create_dataset ( 'y' , data = dataset . get_targets ( ) ) trainer = yaml_parse . load ( ( load_all_yaml % { 'filename' : filename } ) ) trainer . main_loop ( ) os . remove ( filename )
train using an hdf5 dataset with all data loaded into memory .