qualia2.data package¶
Submodules¶
qualia2.data.basic module¶
-
class
qualia2.data.basic.Spiral(num_class=3, num_data=100)[source]¶ Bases:
qualia2.data.dataset.DatasetSpiral Dataset
- Args:
num_class (int): number of classes num_data (int): number of data for each classes
- Shape:
data: [num_class*num_data, 2]
label: [num_class*num_data, num_class]
-
class
qualia2.data.basic.SwissRoll(num_class=5, num_data=2000)[source]¶ Bases:
qualia2.data.dataset.DatasetSwiss roll dataset
- Args:
num_class (int): number of classes num_data (int): number of data for each classes
- Note:
num_data % num_class == 0
qualia2.data.cifar module¶
-
class
qualia2.data.cifar.CIFAR10(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetCIFAR10 Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 3*32*32]. Default: False
- Shape:
data: [N, 3, 32, 32]
-
class
qualia2.data.cifar.CIFAR100(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None, label_type='fine')[source]¶ Bases:
qualia2.data.dataset.DatasetCIFAR100 Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 3*32*32]. Default: False label_type (str): “fine” label (the class to which it belongs) or “coarse” label (the superclass to which it belongs)
- Shape:
data: [N, 3, 32, 32]
qualia2.data.dataloader module¶
qualia2.data.dataset module¶
qualia2.data.emnist module¶
-
class
qualia2.data.emnist.EMNIST(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetEMNIST Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 1, 28, 28]
qualia2.data.fashion_mnist module¶
-
class
qualia2.data.fashion_mnist.FashionMNIST(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetFashionMNIST Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 1, 28, 28]
qualia2.data.fimlp module¶
-
class
qualia2.data.fimlp.FIMLP(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetFIMLP Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 96*96]. Default: False
- Shape:
data: [N, 1, 96, 96] if flatten [N, 96*96]
- Label:
Only x and y of the eyes center, nose tip and mouth center will be used as a label by default due to its small number of missing values. Landmarks Missing left_eye_center_x 10 left_eye_center_y 10 right_eye_center_x 13 right_eye_center_y 13 # left_eye_inner_corner_x 4778 # left_eye_inner_corner_y 4778 # left_eye_outer_corner_x 4782 # left_eye_outer_corner_y 4782 # right_eye_inner_corner_x 4781 # right_eye_inner_corner_y 4781 # right_eye_outer_corner_x 4781 # right_eye_outer_corner_y 4781 # left_eyebrow_inner_end_x 4779 # left_eyebrow_inner_end_y 4779 # left_eyebrow_outer_end_x 4824 # left_eyebrow_outer_end_y 4824 # right_eyebrow_inner_end_x 4779 # right_eyebrow_inner_end_y 4779 # right_eyebrow_outer_end_x 4813 # right_eyebrow_outer_end_y 4813 nose_tip_x 0 nose_tip_y 0 # mouth_left_corner_x 4780 # mouth_left_corner_y 4780 # mouth_right_corner_x 4779 # mouth_right_corner_y 4779 # mouth_center_top_lip_x 4774 # mouth_center_top_lip_y 4774 mouth_center_bottom_lip_x 33 mouth_center_bottom_lip_y 33
qualia2.data.kuzushi_mnist module¶
-
class
qualia2.data.kuzushi_mnist.Kuzushi49(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetKuzushi49 Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 1, 28, 28]
-
class
qualia2.data.kuzushi_mnist.KuzushiMNIST(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetKuzushiMNIST Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 1, 28, 28] if flatten [N, 28*28]
qualia2.data.mnist module¶
-
class
qualia2.data.mnist.MNIST(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetMNIST Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 1, 28, 28]
qualia2.data.stl10 module¶
-
class
qualia2.data.stl10.STL10(train=True, transforms=Compose(transforms=[ToTensor(), Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]), target_transforms=None)[source]¶ Bases:
qualia2.data.dataset.DatasetSTL10 Dataset
- Args:
normalize (bool): If true, the intensity value of a specific pixel in a specific image will be rescaled from [0, 255] to [0, 1]. Default: True flatten (bool): If true, data will have a shape of [N, 28*28]. Default: False
- Shape:
data: [N, 3, 96, 96] if flatten [N, 3*96*96]
qualia2.data.transforms module¶
-
class
qualia2.data.transforms.CenterCrop(size)[source]¶ Bases:
objectCrops the given PIL Image at the center. Args:
size (int): Desired output size of the crop.
-
class
qualia2.data.transforms.Compose(transforms=[])[source]¶ Bases:
objectComposes several transforms together. Args:
transforms (list): list of transforms
-
class
qualia2.data.transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])[source]¶ Bases:
objectNormalize a tensor image with mean and standard deviation.