jactorch.data.dataset#

Classes

Dataset

An abstract class representing a Dataset.

FilterableDatasetUnwrapped

A filterable dataset.

FilterableDatasetView

IterableDatasetMixin

JacDataset

ListDataset

Wraps a list into a pytorch Dataset.

ProxyDataset

A proxy dataset base class for wrapping a base dataset.

Class Dataset

class Dataset[source]#

Bases: object

An abstract class representing a Dataset.

All other datasets_v1 should subclass it. All subclasses should override __len__, that provides the size of the dataset, and __getitem__, supporting integer indexing in range from 0 to len(self) exclusive.

__add__(other)[source]#
__init__()#
__new__(**kwargs)#

Class FilterableDatasetUnwrapped

class FilterableDatasetUnwrapped[source]#

Bases: Dataset, IterableDatasetMixin

A filterable dataset. User can call various filter_* operations to obtain a subset of the dataset.

__add__(other)#
__init__()[source]#
__new__(**kwargs)#
get_metainfo(index)[source]#

Class FilterableDatasetView

class FilterableDatasetView[source]#

Bases: FilterableDatasetUnwrapped

__add__(other)#
__init__(owner_dataset, indices=None, filter_name=None, filter_func=None)[source]#
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.

__new__(**kwargs)#
collect(key_func)[source]#
filter(filter_func, filter_name=None)[source]#
get_metainfo(index)[source]#
random_shuffle()[source]#
random_trim_length(length)[source]#
repeat(nr_repeats)[source]#
sort(key, key_name=None)[source]#
split_kfold(k)[source]#
split_trainval(split)[source]#
trim_length(length)[source]#
trim_range(begin, end=None)[source]#
property filter_func#
property filter_name#
property full_filter_name#
property unwrapped#

Class IterableDatasetMixin

class IterableDatasetMixin[source]#

Bases: object

__init__()#
__new__(**kwargs)#

Class JacDataset

class JacDataset[source]#

Bases: Dataset, IterableDatasetMixin

__add__(other)#
__init__()#
__new__(**kwargs)#

Class ListDataset

class ListDataset[source]#

Bases: Dataset

Wraps a list into a pytorch Dataset.

__add__(other)#
__init__(list)[source]#
Parameters:

list (list[Any]) – the list of data.

__new__(**kwargs)#

Class ProxyDataset

class ProxyDataset[source]#

Bases: Dataset

A proxy dataset base class for wrapping a base dataset.

__add__(other)#
__init__(base_dataset)[source]#
Parameters:

base_dataset (Dataset) – the base dataset.

__new__(**kwargs)#
property base_dataset#