当前位置:网站首页>Tensorflow2.0 confusion matrix does not match printing accuracy
Tensorflow2.0 confusion matrix does not match printing accuracy
2022-07-30 19:02:00 【Heke】
Recently working on a binary classification project, the last few layers of the model are like this, and finally activated with sigmiod.
model.add(tf.keras.layers.Dense(64, activation='relu'))model.add(tf.keras.layers.Dropout(0.5)),model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
The loss function uses this
tf.keras.losses.binary_crossentropy
Just run it
model.fit(...)
The effect of the printed information is not bad. Finally, I took a look at the confusion matrix again, and I vomited.In this way, it is OK to use y_pred
.
pred = self.model.predict(x)y_pred = (pred>0.5).astype(int)
边栏推荐
猜你喜欢
谷歌AlphaFold近日宣称预测出地球上几乎所有蛋白质结构
运营 23 年,昔日“国内第一大电商网站”黄了...
OneFlow source code analysis: Op, Kernel and interpreter
Spark学习:用spark实现ETL
golang日志库zerolog使用记录
SwiftUI iOS 精品开源项目之 完整烘焙食品菜谱App基于SQLite(教程含源码)
kotlin的by lazy
MySQL数据类型
延时队列优化 (2)
6 yuan per catty, why do Japanese companies come to China to collect cigarette butts?
随机推荐
Deepen school-enterprise cooperation and build an "overpass" for the growth of technical and skilled talents
SimpleOSS third-party library libcurl and engine libcurl error solution
The Meta metaverse division lost 2.8 billion in the second quarter!Still want to keep betting?Metaverse development has yet to see a way out!
【总结】1396- 60+个 VSCode 插件,打造好用的编辑器
Vulkan开启特征(feature)的正确姿势
- daily a LeetCode 】 【 191. A number of 1
node封装一个控制台进度条插件
自然语言处理nltk
Anaconda Navigator卡在loading applications
还有三天忙完
固定资产可视化智能管理系统
vxe-table实现复选框鼠标拖动选中
MySQL data types
Multiple instances of mysql
Recommendation | People who are kind to you, don't repay them by inviting them to eat
NXP IMX8QXP更换DDR型号操作流程
requet.getHeader(“token“) 为null
第14章 类型信息
[Use of Qt Designer tool]
设计消息队列存储消息数据的 MySQL 表格