(self)
return classes_per_split
Returns a dict mapping each split enum to the number of its classes.
Returns a dict mapping each split enum to the number of its classes.
Returns a dict mapping each split enum to the number of its classes .
def get_classes_per_split(self):
    """Returns a dict mapping each split enum to the number of its classes."""

    def count_split_classes(split):
      graph = self.split_subgraphs[split]
      leaves = imagenet_specification.get_leaves(graph)
      return len(leaves)

    classes_per_split = {}
    for split in [
        learning_spec.Split.TRAIN, learning_spec.Split.VALID,
        learning_spec.Split.TEST
    ]:
      classes_per_split[split] = count_split_classes(split)
    return classes_per_split
def get_classes_per_split ( self ) : def count_split_classes ( split ) : graph = self . split_subgraphs [ split ] leaves = imagenet_specification . get_leaves ( graph ) return len ( leaves ) classes_per_split = { } for split in [ learning_spec . Split . TRAIN , learning_spec . Split . VALID , learning_spec . Split . TEST ] : classes_per_split [ split ] = count_split_classes ( split ) return classes_per_split