hyrax.data_sets.hyrax_cifar_data_set

Attributes

logger

Classes

HyraxCifarBase

Base class for Hyrax Cifar datasets

HyraxCifarDataSet

Map style CIFAR 10 dataset for Hyrax

HyraxCifarIterableDataSet

Iterable style CIFAR 10 dataset for Hyrax

Module Contents

logger[source]
class HyraxCifarBase(config: hyrax.config_utils.ConfigDict)[source]

Base class for Hyrax Cifar datasets

cifar[source]
class HyraxCifarDataSet(config: hyrax.config_utils.ConfigDict)[source]

Bases: HyraxCifarBase, hyrax.data_sets.data_set_registry.HyraxDataset, torch.utils.data.Dataset

Map style CIFAR 10 dataset for Hyrax

This is simply a version of CIFAR10 that is initialized using Hyrax config with a transformation that works well for example code.

We only use the training split in the data, because it is larger (50k images). Hyrax will then divide that into Train/test/Validate according to configuration.

__init__()[source]

Overall initialization for all DataSets which saves the config

Subclasses of HyraxDataSet ought call this at the end of their __init__ like:

from hyrax.data_sets import HyraxDataset
from torch.utils.data import Dataset

class MyDataset(HyraxDataset, Dataset):
    def __init__(config):
        <your code>
        super().__init__(config)

If per tensor metadata is available, it is recommended that dataset authors create an astropy Table of that data, in the same order as their data and pass that metadata_table as shown below:

from hyrax.data_sets import HyraxDataset
from torch.utils.data import Dataset
from astropy.table import Table

class MyDataset(HyraxDataset, Dataset):
    def __init__(config):
        <your code>
        metadata_table = Table(<Your catalog data goes here>)
        super().__init__(config, metadata_table)
Parameters:
  • config (ConfigDict, Optional) – The runtime configuration for hyrax

  • metadata_table (Optional[Table], optional) – An Astropy Table with 1. the metadata columns desired for visualization AND 2. in the order your data will be enumerated.

__len__()[source]
__getitem__(idx)[source]
class HyraxCifarIterableDataSet(config: hyrax.config_utils.ConfigDict)[source]

Bases: HyraxCifarBase, hyrax.data_sets.data_set_registry.HyraxDataset, torch.utils.data.IterableDataset

Iterable style CIFAR 10 dataset for Hyrax

This is simply a version of CIFAR10 that is initialized using Hyrax config with a transformation that works well for example code. This version only supports iteration, and not map-style access

We only use the training split in the data, because it is larger (50k images). Hyrax will then divide that into Train/test/Validate according to configuration.

__init__()[source]

Overall initialization for all DataSets which saves the config

Subclasses of HyraxDataSet ought call this at the end of their __init__ like:

from hyrax.data_sets import HyraxDataset
from torch.utils.data import Dataset

class MyDataset(HyraxDataset, Dataset):
    def __init__(config):
        <your code>
        super().__init__(config)

If per tensor metadata is available, it is recommended that dataset authors create an astropy Table of that data, in the same order as their data and pass that metadata_table as shown below:

from hyrax.data_sets import HyraxDataset
from torch.utils.data import Dataset
from astropy.table import Table

class MyDataset(HyraxDataset, Dataset):
    def __init__(config):
        <your code>
        metadata_table = Table(<Your catalog data goes here>)
        super().__init__(config, metadata_table)
Parameters:
  • config (ConfigDict, Optional) – The runtime configuration for hyrax

  • metadata_table (Optional[Table], optional) – An Astropy Table with 1. the metadata columns desired for visualization AND 2. in the order your data will be enumerated.

__iter__()[source]