当前位置:网站首页>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))
边栏推荐
- 75. Color classification (medium array double pointer sorting)
- Kali source solution software cannot be installed correctly
- CMD common commands
- Command line agent: proxychains configuration
- [reprint] the token token is used in the login scenario
- PC side web page effects (client series, scroll series, immediate function execution, sidebar effects)
- npm ERR code ETIMEDOUT npm ERR syscall connect npm ERR errno ETIMEDOUT npm ERR network reques...
- MKD [anomaly detection: knowledge disruption]
- winform跳转第二个窗体案例
- 770. Word replacement
猜你喜欢

How to delete and remove the first row of elements in PHP two-dimensional array

Static details of static members

Lvs+keepalived high availability deployment practical application

Att & CK preliminary understanding

PaddleNLP基于ERNIR3.0文本分类以CAIL2018-SMALL数据集罪名预测任务为例【多标签】

Att & CK Threat Intelligence

Soft exam network engineer

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

Bluetooth smart Bracelet system based on STM32 MCU

Target segmentation learning
随机推荐
STM32 - interrupt overview (interrupt priority)
What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
Changes in the history of oscilloscope development
Concise history of graphic technology
ssh免密登陆
STM32CUBEIDE(10)----ADC在DMA模式下扫描多个通道
How to use sprintf function
Sword finger offer II 064. magic Dictionary (medium dictionary tree string design)
ES6 concept
GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道
How about the actual use effect of common source oscilloscope
Idea generate class diagram plug-in UML (super detailed)
Summary of recent bugs
JS implementation generates a random key of specified length
776. 字符串移位包含问题
Awk blank line filtering
PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
There will be a black line on the border when the button in the wechat applet is clicked
Research cup element recognition multi label classification task based on ernie-3.0 cail2019 method
BOM (location object, navigation object)