(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_train_80_10_10(self, build, split, shuffle_files):
    """One of the default setting to build dataset."""
    # Those supervised datasets have a single dataset and do not provide
    # train/validation/test splits. We split the dataset 80/10/10.
    split_patterns = {
        "train": "train[:80%]",
        "validation": "train[80%:90%]",
        "test": "train[90%:]"
    }
    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 * 0.8
    elif split == "validation":
      num_examples = info.splits["train"].num_examples * 0.1
    else:
      num_examples = info.splits["train"].num_examples * 0.1
    return dataset, num_examples
def _split_train_80_10_10 ( self , build , split , shuffle_files ) : # Those supervised datasets have a single dataset and do not provide # train/validation/test splits. We split the dataset 80/10/10. split_patterns = { "train" : "train[:80%]" , "validation" : "train[80%:90%]" , "test" : "train[90%:]" } 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 * 0.8 elif split == "validation" : num_examples = info . splits [ "train" ] . num_examples * 0.1 else : num_examples = info . splits [ "train" ] . num_examples * 0.1 return dataset , num_examples