fix bug with samples that were not clipped after tanh-untanh transformations, upd README.md

This commit is contained in:
iperov 2019-02-10 10:45:51 +04:00
parent 51a13c90d1
commit 854ab11de3
3 changed files with 16 additions and 8 deletions

View file

@ -197,9 +197,12 @@ class SampleProcessor(object):
else:
raise ValueError ('expected SampleTypeFlags mode')
if not debug and sample_process_options.normalize_tanh:
img = img * 2.0 - 1.0
if not debug:
if sample_process_options.normalize_tanh:
img = np.clip (img * 2.0 - 1.0, -1.0, 1.0)
else:
img = np.clip (img, 0.0, 1.0)
outputs.append ( img )
if debug: