pylint edits
This commit is contained in:
parent
ec2204ac97
commit
4784b0f31e
1 changed files with 13 additions and 13 deletions
|
@ -107,7 +107,7 @@ def image_whitening(data):
|
||||||
data[i, :, :, :] -= mean[i] * ones
|
data[i, :, :, :] -= mean[i] * ones
|
||||||
|
|
||||||
# Compute adjusted standard variance
|
# Compute adjusted standard variance
|
||||||
adj_std_var = np.maximum(np.ones(len(data), dtype=np.float32) / math.sqrt(nb_pixels), np.std(data, axis=(1,2,3))) #NOLINT(long-line)
|
adj_std_var = np.maximum(np.ones(len(data), dtype=np.float32) / math.sqrt(nb_pixels), np.std(data, axis=(1, 2, 3))) # pylint: disable=line-too-long
|
||||||
|
|
||||||
# Divide image
|
# Divide image
|
||||||
for i in xrange(len(data)):
|
for i in xrange(len(data)):
|
||||||
|
@ -148,15 +148,15 @@ def extract_svhn(local_url):
|
||||||
return data, labels
|
return data, labels
|
||||||
|
|
||||||
|
|
||||||
def unpickle_cifar_dic(file):
|
def unpickle_cifar_dic(file): # pylint: disable=redefined-builtin
|
||||||
"""
|
"""
|
||||||
Helper function: unpickles a dictionary (used for loading CIFAR)
|
Helper function: unpickles a dictionary (used for loading CIFAR)
|
||||||
:param file: filename of the pickle
|
:param file: filename of the pickle
|
||||||
:return: tuple of (images, labels)
|
:return: tuple of (images, labels)
|
||||||
"""
|
"""
|
||||||
fo = open(file, 'rb')
|
file_obj = open(file, 'rb')
|
||||||
data_dict = pickle.load(fo)
|
data_dict = pickle.load(file_obj)
|
||||||
fo.close()
|
file_obj.close()
|
||||||
return data_dict['data'], data_dict['labels']
|
return data_dict['data'], data_dict['labels']
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,8 +176,8 @@ def extract_cifar10(local_url, data_dir):
|
||||||
'/cifar10_test_labels.npy']
|
'/cifar10_test_labels.npy']
|
||||||
|
|
||||||
all_preprocessed = True
|
all_preprocessed = True
|
||||||
for file in preprocessed_files:
|
for file_name in preprocessed_files:
|
||||||
if not tf.gfile.Exists(data_dir + file):
|
if not tf.gfile.Exists(data_dir + file_name):
|
||||||
all_preprocessed = False
|
all_preprocessed = False
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue