Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Out of the box, LeakGAN does not work when specified through
main.py
. Instead, an error occurs that TensorFlow flags doesn't know how to parse argument'g'
. This is due to the fact thatmain.py
parses arguments withgetopt
, but the LeakGAN constructor usestf.app.flags
.Changes
To get LeakGAN to work properly, I modified
main.py
to also utilizetf.app.flags
. Since these flags are intended to be global and distributed, it's perfectly legal to have flags specified in different parts of the system (i.e. LeakGAN specific args only in the LeakGAN constructor). The overall functionality is identical, with the exception thatmain.py
args need to use their longform version (e.g.--gan_type
instead of just-g
).Additionally, I factored out the definitions of the
test_file
,oracle_file
, andgenerator_file
to theGan
class (since they were used by every GAN type), and made them able to be specified by CLI args as well.