Exemplo n.º 1
0
    def get_data_loader(self):
        """Return a DataLoader object."""
        if self.verbose:
            print('==> Load the dataset\'s metadata.')

        data_dir_path, hdf5_filepath = self.get_cache_paths()
        return DataLoader(name=self.name,
                          task=self.task,
                          data_dir=data_dir_path,
                          hdf5_filepath=hdf5_filepath)
Exemplo n.º 2
0
    def get_test_dataset_DataLoader(self):
        """Return a dataset for testing the FieldLoader class."""
        test_info = self.get_test_DataLoader_info()
        name = test_info["name"]
        task = test_info["task"]
        data_dir = test_info["data_dir"]
        hdf5_file = test_info["hdf5_file"]

        data_loader = DataLoader(name, task, data_dir, hdf5_file)

        return data_loader, self.dataset, self.data_fields
Exemplo n.º 3
0
    def test__init(self):
        name = 'some_db'
        task = 'task'
        data_dir = './some/dir'
        hdf5_file = db_generator.get_test_hdf5_filepath_DataLoader()

        data_loader = DataLoader(name, task, data_dir, hdf5_file)

        assert data_loader.db_name == name
        assert data_loader.task == task
        assert data_loader.data_dir == data_dir
        assert data_loader.hdf5_filepath == hdf5_file
        assert 'train' in data_loader.sets
Exemplo n.º 4
0
 def get_loader_obj(self, data_dir, hdf5_filepath):
     return DataLoader(name=self.name,
                       task=self.task,
                       data_dir=data_dir,
                       hdf5_filepath=hdf5_filepath)