MCPcopy Create free account
hub / github.com/google-research/language / experiment_function

Function experiment_function

language/labs/memory/run_models.py:277–304  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

275
276
277def 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
307def main(_):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…