built-in support for ealy stopping in tensorflow estimator -
is there built-in stopping function in tensorflow? check hooks provided tf.estimator, don't find anything. or need implement myself?
@maxime, experiment works! here part of code, in case interest in answer. there feature in contrib, maynot stable.
config = tf.contrib.learn.runconfig(model_dir=flags.train_dir) # config = config.replace(sess_config=sess_config) tf.logging.set_verbosity(logging.info) validation_monitor = monitors.validationmonitor( input_fn=functools.partial(input_fn, subset="evaluation"), eval_steps=128, every_n_steps=101, early_stopping_metric="accuracy", early_stopping_rounds = 1000 ) run_monitors = [validation_monitor] tf.contrib.learn.learn_runner.run( get_experiment_fn(train_input_fn=functools.partial(input_fn,subset="training"), eval_input_fn=functools.partial(input_fn,subset="evaluation"), train_steps=flags.train_steps, eval_steps=100, train_hooks=run_monitors, model_fn=model_fn_cnn ), run_config = config )
Comments
Post a Comment