博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
BERT中文 添加 early_stop
阅读量:4708 次
发布时间:2019-06-10

本文共 534 字,大约阅读时间需要 1 分钟。

Step1:建一个hook

early_stopping_hook = tf.contrib.estimator.stop_if_no_decrease_hook(            estimator=estimator,            metric_name='eval_loss',            max_steps_without_decrease=FLAGS.max_steps_without_decrease,            eval_dir=None,            min_steps=0,            run_every_secs=None,            run_every_steps=FLAGS.save_checkpoints_steps)

 

Step2:加到estimator.train里

estimator.train(input_fn=train_input_fn, max_steps=num_train_steps, hooks=[early_stopping_hook])

 

转载于:https://www.cnblogs.com/cupleo/p/10272923.html

你可能感兴趣的文章
斑马为什么有条纹?
查看>>
android多层树形结构列表学习笔记
查看>>
Android_去掉EditText控件周围橙色高亮区域
查看>>
《构建之法》第一、二、十六章阅读笔记
查看>>
arrow:让Python的日期与时间变的更好
查看>>
(转)Excel的 OleDb 连接串的格式(连接Excel 2003-2013)
查看>>
Java并发编程
查看>>
Git Stash用法
查看>>
sql server 2008学习8 sql server存储和索引结构
查看>>
Jquery radio选中
查看>>
memcached 细究(三)
查看>>
RSA System.Security.Cryptography.CryptographicException
查看>>
webservice整合spring cxf
查看>>
[解题报告] 100 - The 3n + 1 problem
查看>>
Entity Framework 学习高级篇1—改善EF代码的方法(上)
查看>>
Mybatis逆向工程配置文件详细介绍(转)
查看>>
String类的深入学习与理解
查看>>
不把DB放进容器的理由
查看>>
OnePage收集
查看>>
Java parseInt()方法
查看>>