It iterates trials by running the Experiment for each trial with the
corresponding hyper-parameters. For each trial, it retrieves the
hyper-parameters from tuner, creates an Experiment by calling experiment_fn,
and then reports the measure back to tuner.
Args:
experiment_fn: A function that creates an Experiment. It should accept an
argument run_config which should be used to create the Estimator (
passed as config to its constructor), and an argument hparams, which
should be used for hyper-parameters tuning. It must return an
Experiment.
tuner: A Tuner instance.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.learn.learn_runner.tune\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/learn/python/learn/learn_runner.py#L228-L262) |\n\nTune an experiment with hyper-parameters. (deprecated) \n\n tf.contrib.learn.learn_runner.tune(\n experiment_fn, tuner\n )\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.estimator.train_and_evaluate.\n\nIt iterates trials by running the Experiment for each trial with the\ncorresponding hyper-parameters. For each trial, it retrieves the\nhyper-parameters from `tuner`, creates an Experiment by calling experiment_fn,\nand then reports the measure back to `tuner`.\n\n#### Example:\n\n def _create_my_experiment(run_config, hparams):\n hidden_units = [hparams.unit_per_layer] * hparams.num_hidden_layers\n\n return tf.contrib.learn.Experiment(\n estimator=DNNClassifier(config=run_config, hidden_units=hidden_units),\n train_input_fn=my_train_input,\n eval_input_fn=my_eval_input)\n\n tuner = create_tuner(study_configuration, objective_key)\n\n learn_runner.tune(experiment_fn=_create_my_experiment, tuner)\n\nArgs:\nexperiment_fn: A function that creates an `Experiment`. It should accept an\nargument `run_config` which should be used to create the `Estimator` (\npassed as `config` to its constructor), and an argument `hparams`, which\nshould be used for hyper-parameters tuning. It must return an\n`Experiment`.\ntuner: A `Tuner` instance."]]