hyrax.datasets.hyrax_cifar_dataset#

Attributes#

Classes#

HyraxCifarDataset

Map style CIFAR 10 dataset for Hyrax

Module Contents#

logger[source]#
class HyraxCifarDataset(config: dict, data_location: pathlib.Path = None)[source]#

Bases: hyrax.datasets.dataset_registry.HyraxDataset

Map style CIFAR 10 dataset for Hyrax

This utilizes the CIFAR dataset from torchvision for retrieving the dataset.

__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.datasets import HyraxDataset

class MyDataset(HyraxDataset):
    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.datasets import HyraxDataset
from astropy.table import Table

class MyDataset(HyraxDataset):
    def __init__(config):
        <your code>
        metadata_table = Table(<Your catalog data goes here>)
        super().__init__(config, metadata_table)
Parameters:
  • config (dict, 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.

  • object_id_column_name (Optional[str], optional) – The name of the column containing object IDs. If None, uses the default from config or creates one from the ids() method.

data_location = None[source]#
training_data[source]#
cifar[source]#
id_width = 0[source]#
get_image(idx)[source]#

Get the image at the given index as a NumPy array.

get_label(idx)[source]#

Get the label at the given index.

get_object_id(idx)[source]#

Get the object ID for the item as a string.

__len__()[source]#