Closed kumarneelabh13 closed 5 years ago
I got it. So all the train and test samples get re-scaled according to the normal class values.
train_set_full = MyMNIST(root=root, train=True, download=True,
transform=None, target_transform=None)
MIN = []
MAX = []
for normal_classes in range(10):
train_idx_normal = get_target_label_idx(train_set_full.train_labels.clone().data.cpu().numpy(), normal_classes)
train_set = Subset(train_set_full, train_idx_normal)
_min_ = []
_max_ = []
for idx in train_set.indices:
gcm = global_contrast_normalization(train_set.dataset.data[idx].float(), 'l1')
_min_.append(gcm.min())
_max_.append(gcm.max())
MIN.append(np.min(_min_))
MAX.append(np.max(_max_))
print(list(zip(MIN, MAX)))
I think there's a problem with precomputing min-max values for separate classes. The problem is that this technique will not be suitable for a new and "unknown" sample.
from datasets/cifar10.py
Or am I missing something?