(self, build, split, shuffle_files)
return dataset, num_examples
One of the default setting to build dataset.
One of the default setting to build dataset.
One of the default setting to build dataset .
def _split_validation_50_50(self, build, split, shuffle_files):
    """One of the default setting to build dataset."""
    # Those large pretraining datasets have not have test set.
    # We split the validation dataset 50/50 as validation/test.
    split_patterns = {
        "train": "train",
        "validation": "validation[50%:]",
        "test": "validation[50%:]"
    }
    dataset, info = tfds.load(
        self.override_build(build),
        as_supervised=self.is_supervised,
        split=split_patterns[split],
        shuffle_files=shuffle_files,
        with_info=True,
        data_dir=self.data_dir)
    if split == "train":
      num_examples = info.splits["train"].num_examples
    elif split == "validation":
      num_examples = info.splits["validation"].num_examples * 0.5
    else:
      num_examples = info.splits["validation"].num_examples * 0.5
    return dataset, num_examples
def _split_validation_50_50 ( self , build , split , shuffle_files ) : # Those large pretraining datasets have not have test set. # We split the validation dataset 50/50 as validation/test. split_patterns = { "train" : "train" , "validation" : "validation[50%:]" , "test" : "validation[50%:]" } dataset , info = tfds . load ( self . override_build ( build ) , as_supervised = self . is_supervised , split = split_patterns [ split ] , shuffle_files = shuffle_files , with_info = True , data_dir = self . data_dir ) if split == "train" : num_examples = info . splits [ "train" ] . num_examples elif split == "validation" : num_examples = info . splits [ "validation" ] . num_examples * 0.5 else : num_examples = info . splits [ "validation" ] . num_examples * 0.5 return dataset , num_examples