result.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Importing for Backward Compatibility
  2. from ray.air.constants import ( # noqa: F401
  3. EXPR_ERROR_FILE,
  4. EXPR_ERROR_PICKLE_FILE,
  5. EXPR_PARAM_FILE,
  6. EXPR_PARAM_PICKLE_FILE,
  7. EXPR_PROGRESS_FILE,
  8. EXPR_RESULT_FILE,
  9. TIME_THIS_ITER_S,
  10. TIMESTAMP,
  11. TRAINING_ITERATION,
  12. )
  13. # fmt: off
  14. # __sphinx_doc_begin__
  15. # (Optional/Auto-filled) training is terminated. Filled only if not provided.
  16. DONE = "done"
  17. # (Optional) Enum for user controlled checkpoint
  18. SHOULD_CHECKPOINT = "should_checkpoint"
  19. # (Auto-filled) The hostname of the machine hosting the training process.
  20. HOSTNAME = "hostname"
  21. # (Auto-filled) The auto-assigned id of the trial.
  22. TRIAL_ID = "trial_id"
  23. # (Auto-filled) The auto-assigned id of the trial.
  24. EXPERIMENT_TAG = "experiment_tag"
  25. # (Auto-filled) The node ip of the machine hosting the training process.
  26. NODE_IP = "node_ip"
  27. # (Auto-filled) The pid of the training process.
  28. PID = "pid"
  29. # (Optional) Default (anonymous) metric when using tune.report(x)
  30. DEFAULT_METRIC = "_metric"
  31. # (Optional) Mean reward for current training iteration
  32. EPISODE_REWARD_MEAN = "episode_reward_mean"
  33. # (Optional) Mean loss for training iteration
  34. MEAN_LOSS = "mean_loss"
  35. # (Optional) Mean accuracy for training iteration
  36. MEAN_ACCURACY = "mean_accuracy"
  37. # Number of episodes in this iteration.
  38. EPISODES_THIS_ITER = "episodes_this_iter"
  39. # (Optional/Auto-filled) Accumulated number of episodes for this trial.
  40. EPISODES_TOTAL = "episodes_total"
  41. # Number of timesteps in this iteration.
  42. TIMESTEPS_THIS_ITER = "timesteps_this_iter"
  43. # (Auto-filled) Accumulated number of timesteps for this entire trial.
  44. TIMESTEPS_TOTAL = "timesteps_total"
  45. # (Auto-filled) Accumulated time in seconds for this entire trial.
  46. TIME_TOTAL_S = "time_total_s"
  47. # __sphinx_doc_end__
  48. # fmt: on
  49. DEFAULT_EXPERIMENT_INFO_KEYS = ("trainable_name", EXPERIMENT_TAG, TRIAL_ID)
  50. DEFAULT_RESULT_KEYS = (
  51. TRAINING_ITERATION,
  52. TIME_TOTAL_S,
  53. MEAN_ACCURACY,
  54. MEAN_LOSS,
  55. )
  56. # Metrics that don't require at least one iteration to complete
  57. DEBUG_METRICS = (
  58. TRIAL_ID,
  59. "experiment_id",
  60. "date",
  61. TIMESTAMP,
  62. PID,
  63. HOSTNAME,
  64. NODE_IP,
  65. "config",
  66. )
  67. # Make sure this doesn't regress
  68. AUTO_RESULT_KEYS = (
  69. TRAINING_ITERATION,
  70. TIME_TOTAL_S,
  71. EPISODES_TOTAL,
  72. TIMESTEPS_TOTAL,
  73. NODE_IP,
  74. HOSTNAME,
  75. PID,
  76. TIME_TOTAL_S,
  77. TIME_THIS_ITER_S,
  78. TIMESTAMP,
  79. "date",
  80. "time_since_restore",
  81. "timesteps_since_restore",
  82. "iterations_since_restore",
  83. "config",
  84. # TODO(justinvyu): Move this stuff to train to avoid cyclical dependency.
  85. "checkpoint_dir_name",
  86. )
  87. # __duplicate__ is a magic keyword used internally to
  88. # avoid double-logging results when using the Function API.
  89. RESULT_DUPLICATE = "__duplicate__"
  90. # __trial_info__ is a magic keyword used internally to pass trial_info
  91. # to the Trainable via the constructor.
  92. TRIAL_INFO = "__trial_info__"
  93. # __stdout_file__/__stderr_file__ are magic keywords used internally
  94. # to pass log file locations to the Trainable via the constructor.
  95. STDOUT_FILE = "__stdout_file__"
  96. STDERR_FILE = "__stderr_file__"
  97. DEFAULT_EXPERIMENT_NAME = "default"
  98. # Meta file about status under each experiment directory, can be
  99. # parsed by automlboard if exists.
  100. JOB_META_FILE = "job_status.json"
  101. # Meta file about status under each trial directory, can be parsed
  102. # by automlboard if exists.
  103. EXPR_META_FILE = "trial_status.json"
  104. # Config prefix when using ExperimentAnalysis.
  105. CONFIG_PREFIX = "config"