Add support for dict generator input_fn in learn_io (#7045)
* Branch to test_tensorflow * using types.GeneratorType for validation * changed to receving generator function This allows to run multiple epochs of a finite generator * using placeholders as keys to feed dictionary * added correct counter for the index_placeholder added corrections to tests * removing extra spaces * doc_string fixes * Changed logic to handle final batch if the generator ends it restarts to fill the final batch * Added check that dictionary is returned from gen fixes in tests * Fixes in docstrings, tests and target_key bug * All tests fixed and pass * Added generator_input_fn to __init__ * revert repo and branch in dockerfile.devel to original * docstring changes based on reviewer comments * target returns now a dict of labels target_key can now be a list of keys to be used to populate the target * added more test functions for the new label dict possible errors * if label is a single feature return a tensor (to make it work with estimator object) moved asserts to begining of generator_input_fn added test for dictionary with single input as generator return * Added sorting to keys to ensure order * moved _GeneratorFeedFn to contrib * fixed numpy import * Revert "Added sorting to keys to ensure order" This reverts commit 4ad3a0ddee7f263c650fefe9139a95099d457467. # Conflicts: # tensorflow/python/estimator/inputs/queues/feeding_functions.py * removed duplicate generator feed function from contrib feeding_functions.py * indendation fixes and added sorted keys again * fixed imports * removed extra lines from feeding_functions * removed unnecessary import in feeding_functions * fixed sorting of keys added ability to pass any container of target_keys (e.g. list set tuple) raise KeyError if mismatch between genarator dict keys docstring fixes * add empty line between class methods * Fixing some final formatting * Undo misguided types import * fixed indentation back to two spaces
Loading
Please sign in to comment