[Tune] Add export_formats option to export policy graphs (#3868)

In earlier PRs, PR#3585 and PR#3637, export_policy_model and export_policy_checkpoint were introduced for users to export TensorFlow model and checkpoint.

For Ray Tune users, these APIs are not accessible through YAML configurations.

In this pull request, export_formats option is provided to enable users to choose the desired export format.
This commit is contained in:
Tianming Xu
2019-01-31 17:07:27 -08:00
committed by Richard Liaw
parent b9eed2e86c
commit 1302fafc0b
11 changed files with 174 additions and 7 deletions
+4
View File
@@ -72,6 +72,8 @@ class Experiment(object):
checkpoints. A value of 0 (default) disables checkpointing.
checkpoint_at_end (bool): Whether to checkpoint at the end of the
experiment regardless of the checkpoint_freq. Default is False.
export_formats (list): List of formats that exported at the end of
the experiment. Default is None.
max_failures (int): Try to recover a trial from its last
checkpoint at least this many times. Only applies if
checkpointing is enabled. Setting to -1 will lead to infinite
@@ -119,6 +121,7 @@ class Experiment(object):
sync_function=None,
checkpoint_freq=0,
checkpoint_at_end=False,
export_formats=None,
max_failures=3,
restore=None,
repeat=None,
@@ -146,6 +149,7 @@ class Experiment(object):
"sync_function": sync_function,
"checkpoint_freq": checkpoint_freq,
"checkpoint_at_end": checkpoint_at_end,
"export_formats": export_formats or [],
"max_failures": max_failures,
"restore": restore
}