tdeboissiere / DeepLearningImplementations

Implementation of recent Deep Learning papers
MIT License
1.81k stars 652 forks source link

Three small changes to Pix2Pix #81

Closed chigozienri closed 5 years ago

chigozienri commented 5 years ago

1. Respect do_plot flag in models.load Previously models.load would attempt to call keras.utils.plot_model regardless of whether do_train arg was set in main.py.

Edited models.load to have do_plot positional argument. Also edited train.train to have do_plot kwarg, which it uses when it calls models.load.

2. Switched help messages for --nb_epoch and --n_batches_per_epoch Changed help messages and README so

(previously reversed)

3. Dealt with float comparison problem in data_utils.normalization When image pixel values were normalized to -1 - 1 using data_utils.normalize and then inverse normalized to 0 - 1 with data_utils.inverse_normalize, it was possible to end up with out out of range floats (e.g. 1.000001), which would cause matplotlib (which expects floats between 0 and 1) to throw an error. Added a check for this in normalize and inverse_normalize, and changed inverse_normalize to produce 0-255 instead of 0.-1. as this is more reliable.

4. Added logging_dir flag to specify logging directory And propagated support for this through main, train, utils

5. Respect epoch flag Previously saved .h5 every 5 epochs, regardless of the value of the epoch argument. Fixed.