An experiment function satisfying the tf.estimator API. Args: run_config: A learn_running.EstimatorConfig object. hparams: Unused set of hyperparams. Returns: experiment: A tf.contrib.learn.Experiment object.
(run_config, hparams)
| 275 | |
| 276 | |
| 277 | def experiment_function(run_config, hparams): |
| 278 | """An experiment function satisfying the tf.estimator API. |
| 279 | |
| 280 | Args: |
| 281 | run_config: A learn_running.EstimatorConfig object. |
| 282 | hparams: Unused set of hyperparams. |
| 283 | |
| 284 | Returns: |
| 285 | experiment: A tf.contrib.learn.Experiment object. |
| 286 | """ |
| 287 | del hparams |
| 288 | |
| 289 | train_input_fn = partial(input_function, is_train=True) |
| 290 | eval_input_fn = partial(input_function, is_train=False) |
| 291 | |
| 292 | estimator = tf_estimator.Estimator( |
| 293 | model_fn=model_function, |
| 294 | config=run_config, |
| 295 | model_dir=run_config.model_dir) |
| 296 | |
| 297 | experiment = tf.contrib.learn.Experiment( |
| 298 | estimator=estimator, |
| 299 | train_input_fn=train_input_fn, |
| 300 | eval_input_fn=eval_input_fn, |
| 301 | eval_steps=FLAGS.num_eval_steps, |
| 302 | ) |
| 303 | |
| 304 | return experiment |
| 305 | |
| 306 | |
| 307 | def main(_): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…