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