concepts.benchmark.clevr.dataset.CLEVRDatasetFilterableView#

class CLEVRDatasetFilterableView[source]#

Bases: FilterableDatasetView

Methods

collect(key_func)

filter(filter_func[, filter_name])

filter_program_size_raw(max_length)

Filter the questions by the length of the original CLEVR programs (in terms of the number of steps).

filter_question_type(*[, allowed, disallowed])

Filter the questions by the question type.

filter_scene_size(max_scene_size)

Filter the questions by the size of the scene (in terms of the number of objects).

get_metainfo(index)

make_dataloader(batch_size, shuffle, ...)

Make a dataloader for this dataset view.

random_shuffle()

random_trim_length(length)

repeat(nr_repeats)

sort(key[, key_name])

split_kfold(k)

split_trainval(split)

trim_length(length)

trim_range(begin[, end])

Attributes

__add__(other)#
__getitem__(index)#
__init__(owner_dataset, indices=None, filter_name=None, filter_func=None)#
Parameters:
  • owner_dataset (Dataset) – the original dataset.

  • indices (List[int]) – a list of indices that was filterred out.

  • filter_name (str) – human-friendly name for the filter.

  • filter_func (Callable) – just for tracking.

__iter__()#
__len__()#
__new__(**kwargs)#
collect(key_func)#
filter(filter_func, filter_name=None)#
filter_program_size_raw(max_length)[source]#

Filter the questions by the length of the original CLEVR programs (in terms of the number of steps).

Parameters:

max_length (int)

filter_question_type(*, allowed=None, disallowed=None)[source]#

Filter the questions by the question type.

Parameters:
  • allowed – a set of allowed question types.

  • disallowed – a set of disallowed question types. Only one of allowed and disallowed can be provided.

Returns:

a new dataset view.

filter_scene_size(max_scene_size)[source]#

Filter the questions by the size of the scene (in terms of the number of objects).

Parameters:

max_scene_size (int)

get_metainfo(index)#
make_dataloader(batch_size, shuffle, drop_last, nr_workers)[source]#

Make a dataloader for this dataset view.

Parameters:
  • batch_size (int) – the batch size.

  • shuffle (bool) – whether to shuffle the dataset.

  • drop_last (bool) – whether to drop the remaining samples that are smaller than the batch size.

  • nr_workers (int) – the number of workers for the dataloader.

Returns:

a JacDataLoader instance.

Return type:

JacDataLoader

random_shuffle()#
random_trim_length(length)#
repeat(nr_repeats)#
sort(key, key_name=None)#
split_kfold(k)#
split_trainval(split)#
trim_length(length)#
trim_range(begin, end=None)#
property filter_func#
property filter_name#
property full_filter_name#
property unwrapped#