(self, force_create=False)
return splits
Returns the class splits.

    If the splits already exist in the designated location, they are simply
    read. Otherwise, they are created. For this, first reset the random seed to
    self.seed for reproducibility, then create the splits and finally writes
    them to the designated location.
    The actual split creation takes place in self.create_splits() which each
    sub-class must override.

    Args:
      force_create: bool. if True, the splits will be created even if they
        already exist.

    Returns:
      splits: a dictionary whose keys are 'train', 'valid', and 'test', and
      whose values are lists of the corresponding class names.
Returns the class splits.
Returns the class splits .
def get_splits(self, force_create=False):
    """Returns the class splits.

    If the splits already exist in the designated location, they are simply
    read. Otherwise, they are created. For this, first reset the random seed to
    self.seed for reproducibility, then create the splits and finally writes
    them to the designated location.
    The actual split creation takes place in self.create_splits() which each
    sub-class must override.

    Args:
      force_create: bool. if True, the splits will be created even if they
        already exist.

    Returns:
      splits: a dictionary whose keys are 'train', 'valid', and 'test', and
      whose values are lists of the corresponding class names.
    """
    # Check if the splits already exist.
    if not force_create:
      splits = self.read_splits()
      if splits:
        return splits

    # First, re-set numpy's random seed, for reproducibility.
    np.random.seed(self.seed)

    # Create the dataset-specific splits.
    splits = self.create_splits()

    # Finally, write the splits in the designated location.
    logging.info('Saving new splits for dataset %s at %s...', self.name,
                 self.split_file)
    with tf.io.gfile.GFile(self.split_file, 'w') as f:
      json.dump(splits, f, indent=2)
    logging.info('Done.')

    return splits
def get_splits ( self , force_create = False ) : # Check if the splits already exist. if not force_create : splits = self . read_splits ( ) if splits : return splits # First, re-set numpy's random seed, for reproducibility. np . random . seed ( self . seed ) # Create the dataset-specific splits. splits = self . create_splits ( ) # Finally, write the splits in the designated location. logging . info ( 'Saving new splits for dataset %s at %s...' , self . name , self . split_file ) with tf . io . gfile . GFile ( self . split_file , 'w' ) as f : json . dump ( splits , f , indent = 2 ) logging . info ( 'Done.' ) return splits