[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-02-01 09:07:27 +08:00
committed by Richard Liaw
parent b9eed2e86c
commit 1302fafc0b
11 changed files with 174 additions and 7 deletions
+12
View File
@@ -205,3 +205,15 @@ class TrialExecutor(object):
"""
raise NotImplementedError("Subclasses of TrialExecutor must provide "
"save() method")
def export_trial_if_needed(self, trial):
"""Exports model of this trial based on trial.export_formats.
Args:
trial (Trial): The state of this trial to be saved.
Return:
A dict that maps ExportFormats to successfully exported models.
"""
raise NotImplementedError("Subclasses of TrialExecutor must provide "
"export_trial_if_needed() method")