当前位置:网站首页>Find out the maximum value of all indicators in epoch [tips]
Find out the maximum value of all indicators in epoch [tips]
2022-07-28 22:43:00 【It's too simple】
When running deep learning training , We need to find the model with the best index as the training result , You can use the following program to find .
explain :roc_auc_score: Find the function of any evaluation index , It returns a number
s_obs = Score_Observer('AUROC')
s_obs.update(roc_auc_score(is_anomaly, anomaly_score), epoch,
print_score=True)class Score_Observer:
def __init__(self, name):
self.name = name
self.max_epoch = 0
self.max_score = 0
self.last = 0
def update(self, score, epoch, print_score=False):
self.last = score
if self.max_score == None or score > self.max_score:
self.max_score = score
self.max_epoch = epoch
if print_score:
self.print_score()
def print_score(self):
print('{:s}: \t last: {:.4f} \t max: {:.4f} \t epoch_max: {:d}'.format(self.name, self.last, self.max_score, self.max_epoch))
边栏推荐
- Leetcode integer exercises integer inversion
- 微信小程序里button点击的时候会边框有黑线
- How to install and use PHP library neo4j
- 使用PCL批量将点云.bin文件转.pcd
- Imx6q GPIO multiplexing
- STM32 - advanced control timer (time base unit, functional block diagram, input, capture, output, open circuit)
- elment-plus图标input上面带的图标为什么不显示
- The blueprint of flask complements openpyxl
- Soft exam network engineer
- php二维数组如何删除去除第一行元素
猜你喜欢

The function of wechat applet to cut pictures

Command line agent: proxychains configuration

PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)

Att & CK preliminary understanding

基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务

imx6q gpio复用

Att & CK Threat Intelligence

96. Different binary search trees (medium binary search tree dynamic planning)

Baidu map usage

Static details of static members
随机推荐
Att & CK preliminary understanding
JS convert numbers to letters
Labelme labels circular objects [tips]
How to use sprintf function
ngx+sql环境离线安装日志(rpm安装)
96. Different binary search trees (medium binary search tree dynamic planning)
fatal error: io. h: No such file or directory
PaddleNLP基于ERNIR3.0文本分类:WOS数据集为例(层次分类)
Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
6K6w5LiA5qyh5pS75Ye75YiG5p6Q
Idea generate class diagram plug-in UML (super detailed)
Ngrok intranet penetration
20-09-27项目迁移到阿里折腾记录(网卡顺序导致服务无法通过haproxy连接到db)
Intelligent control -- fuzzy mathematics and control
Image is referred in multiple repositories
PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
PUA in the workplace, but it makes sense
LeetCode刷题系列之-多数之和类型
Command line agent: proxychains configuration
Bluetooth smart Bracelet system based on STM32 MCU