Creates a summary that defines a hyperparameter-tuning experiment. Args: hparam_infos: Array of api_pb2.HParamInfo messages. Describes the hyperparameters used in the experiment. metric_infos: Array of api_pb2.MetricInfo messages. Describes the metrics used in th
(
hparam_infos, metric_infos, user="", description="", time_created_secs=None
)
| 43 | |
| 44 | |
| 45 | def experiment_pb( |
| 46 | hparam_infos, metric_infos, user="", description="", time_created_secs=None |
| 47 | ): |
| 48 | """Creates a summary that defines a hyperparameter-tuning experiment. |
| 49 | |
| 50 | Args: |
| 51 | hparam_infos: Array of api_pb2.HParamInfo messages. Describes the |
| 52 | hyperparameters used in the experiment. |
| 53 | metric_infos: Array of api_pb2.MetricInfo messages. Describes the metrics |
| 54 | used in the experiment. See the documentation at the top of this file |
| 55 | for how to populate this. |
| 56 | user: String. An id for the user running the experiment |
| 57 | description: String. A description for the experiment. May contain markdown. |
| 58 | time_created_secs: float. The time the experiment is created in seconds |
| 59 | since the UNIX epoch. If None uses the current time. |
| 60 | |
| 61 | Returns: |
| 62 | A summary protobuffer containing the experiment definition. |
| 63 | """ |
| 64 | if time_created_secs is None: |
| 65 | time_created_secs = time.time() |
| 66 | experiment = api_pb2.Experiment( |
| 67 | description=description, |
| 68 | user=user, |
| 69 | time_created_secs=time_created_secs, |
| 70 | hparam_infos=hparam_infos, |
| 71 | metric_infos=metric_infos, |
| 72 | ) |
| 73 | return _summary( |
| 74 | metadata.EXPERIMENT_TAG, |
| 75 | plugin_data_pb2.HParamsPluginData(experiment=experiment), |
| 76 | ) |
| 77 | |
| 78 | |
| 79 | def session_start_pb( |