Ensure correct usage of zca_whitening in ImageDataGenerator
* Ensure correct usage of zca_whitening
resolves
* Fix typo samplewise_std_normalization => featurewise_std_normalization
* Force overrides, print warning
* pep8
@@ -479,6 +479,32 @@ class ImageDataGenerator(object):
raise ValueError('`zoom_range` should be a float or '
'a tuple or list of two floats. '
'Received arg: ', zoom_range)
+ if zca_whitening:
+ if not featurewise_center:
+ self.featurewise_center = True
+ warnings.warn('This ImageDataGenerator specifies '
+ '`zca_whitening`, which overrides '
+ 'setting of `featurewise_center`.')
+ if featurewise_std_normalization:
+ self.featurewise_std_normalization = False
+ warnings.warn('This ImageDataGenerator specifies '
+ '`zca_whitening` '
+ 'which overrides setting of'
+ '`featurewise_std_normalization`.')
+ if featurewise_std_normalization:
+ if not featurewise_center:
+ self.featurewise_center = True
+ warnings.warn('This ImageDataGenerator specifies '
+ '`featurewise_std_normalization`, '
+ 'which overrides setting of '
+ '`featurewise_center`.')
+ if samplewise_std_normalization:
+ if not samplewise_center:
+ self.samplewise_center = True
+ warnings.warn('This ImageDataGenerator specifies '
+ '`samplewise_std_normalization`, '
+ 'which overrides setting of '
+ '`samplewise_center`.')
def flow(self, x, y=None, batch_size=32, shuffle=True, seed=None,
save_to_dir=None, save_prefix='', save_format='png'):
