diff --git a/build_label_map.py b/build_label_map.py index 93b01bc..198fa15 100644 --- a/build_label_map.py +++ b/build_label_map.py @@ -113,7 +113,7 @@ def build_single_label_map( We may want many label_maps w/ same value of n_labeled. This allows us to disambiguate. dataset_name: A string representing the name of the dataset. - One of 'cifar10', 'svhn', 'imagenet', or 'cifar_unnormalized'. + One of 'cifar10', 'svhn', 'imagenet'. imagenet_path: A string that encodes the location of the raw imagenet data. fkeys_path: A string that encodes where to read fkeys from and write @@ -143,7 +143,7 @@ def build_single_label_map( result_dict["values"] += random.sample( unique_ids, n_labeled_per_class ) - elif dataset_name in {"cifar10", "svhn", "cifar_unnormalized"}: + elif dataset_name in {"cifar10", "svhn"}: path = os.path.join(fkeys_path, dataset_name, "label_to_fkeys_train") with gfile.GFile(path, "r") as f: label_to_fkeys = json.load(f) diff --git a/build_tfrecords.py b/build_tfrecords.py index c0ce396..916fa08 100644 --- a/build_tfrecords.py +++ b/build_tfrecords.py @@ -67,12 +67,6 @@ "valid": 50050, "extra": 0, }, - "cifar_unnormalized": { - "train": 50000, - "test": 10000, - "valid": 5000, - "extra": 0, - }, } URLS = { @@ -192,8 +186,6 @@ def main(_): train_set, test_set, extra_set = _load_svhn() elif FLAGS.dataset_name == "cifar10": train_set, test_set = _load_cifar10(normalize=True) - elif FLAGS.dataset_name == "cifar_unnormalized": - train_set, test_set = _load_cifar10(normalize=False) elif FLAGS.dataset_name == "imagenet_32": train_set, test_set = _load_imagenet_32() else: diff --git a/lib/dataset_utils.py b/lib/dataset_utils.py index b21654b..852e674 100644 --- a/lib/dataset_utils.py +++ b/lib/dataset_utils.py @@ -39,21 +39,18 @@ DATASET_SHAPE = { "cifar10": (None, 32, 32, 3), - "cifar_unnormalized": (None, 32, 32, 3), "svhn": (None, 32, 32, 3), "svhn_extra": (None, 32, 32, 3), "imagenet_32": (None, 32, 32, 3), } DATASET_DTYPE = { "cifar10": tf.float32, - "cifar_unnormalized": tf.uint8, "svhn": tf.uint8, "svhn_extra": tf.uint8, "imagenet_32": tf.uint8, } DATASET_CLASS_COUNT = { "cifar10": 10, - "cifar_unnormalized": 10, "svhn": 10, "svhn_extra": 10, "imagenet_32": 1000, @@ -61,20 +58,17 @@ DATASET_EXAMPLE_COUNT = { "train": { "cifar10": 50000 - 5000, - "cifar_unnormalized": 50000 - 5000, "svhn": 73257 - 7326, "svhn_extra": 531131, "imagenet_32": 1281167 - 50050, }, "test": { "cifar10": 10000, - "cifar_unnormalized": 10000, "svhn": 26032, "imagenet_32": 50000, }, "valid": { "cifar10": 5000, - "cifar_unnormalized": 5000, "svhn": 7326, "imagenet_32": 50050, }, @@ -309,7 +303,6 @@ def get_filenames(dataset_name, split): if dataset_name in [ "cifar10", "svhn", - "cifar_unnormalized", "imagenet_32", ]: filenames = [os.path.join(paths.TRAIN_DIR, dataset_name, FILES[split])] @@ -332,8 +325,6 @@ def are_datasets_compatible(labeled_dataset_name, unlabeled_dataset_name): Boolean """ valid_combos = [ - ("cifar_unnormalized", "svhn"), - ("svhn", "cifar_unnormalized"), ("svhn", "svhn_extra"), ] return (labeled_dataset_name == unlabeled_dataset_name) or ( diff --git a/lib/hparams.py b/lib/hparams.py index ce61cfd..c86724f 100644 --- a/lib/hparams.py +++ b/lib/hparams.py @@ -75,7 +75,6 @@ def merge_dicts(x, y): # HParam overrides for different datasets cifar10_overrides = dict(horizontal_flip=True) -cifar_unnormalized_overrides = cifar10_overrides imagenet_overrides = dict( horizontal_flip=True, @@ -86,7 +85,6 @@ def merge_dicts(x, y): svhn_overrides = dict(gaussian_noise=False, vat_epsilon=1.0) dataset_overrides = dict( cifar10=cifar10_overrides, - cifar_unnormalized=cifar_unnormalized_overrides, imagenet=imagenet_overrides, imagenet_32=imagenet_overrides, imagenet_64=imagenet_overrides,