当前位置:网站首页>Dice、Sensitivity、ppv、miou
Dice、Sensitivity、ppv、miou
2022-06-25 20:06:00 【Orange cedar】
def dice_coef(output, target):#output To predict the result target For real results
smooth = 1e-5 # prevent 0 except
if torch.is_tensor(output):
output = torch.sigmoid(output).data.cpu().numpy()
if torch.is_tensor(target):
target = target.data.cpu().numpy()
intersection = (output * target).sum()
return (2. * intersection + smooth) / (output.sum() + target.sum() + smooth)
def iou_score(output, target):
smooth = 1e-5
if torch.is_tensor(output):
output = torch.sigmoid(output).data.cpu().numpy()
if torch.is_tensor(target):
target = target.data.cpu().numpy()
output_ = output > 0.5
target_ = target > 0.5
intersection = (output_ & target_).sum()
union = (output_ | target_).sum()
return (intersection + smooth) / (union + smooth)
def sensitivity(output, target):
smooth = 1e-5
if torch.is_tensor(output):
output = torch.sigmoid(output).data.cpu().numpy()
if torch.is_tensor(target):
target = target.data.cpu().numpy()
intersection = (output * target).sum()
return (intersection + smooth)/(target.sum() + smooth)
def ppv(output, target):
smooth = 1e-5
if torch.is_tensor(output):
output = torch.sigmoid(output).data.cpu().numpy()
if torch.is_tensor(target):
target = target.data.cpu().numpy()
intersection = (output * target).sum()
return (intersection + smooth)/(output.sum() + smooth)边栏推荐
- <C>. Calculation date to day conversion
- Yum command
- Vulnhub range the planes: mercury
- Thymleaf template configuration analysis
- Mysql database design suggestions
- Panda weekly -2022/02/18
- Automatic fitting when the applet reaches the top
- <C>. array
- 206. reverse linked list (insert, iteration and recursion)
- Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
猜你喜欢

Automatic fitting when the applet reaches the top

New features of php7

Two types of attribute injection methods

2.14(Knight Moves)

<C>. tic-tac-toe

Short video is just the time. How can you quickly build your video creation ability in your app?

Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup

Bindgetuserinfo will not pop up

Using flex to implement the Holy Grail layout is as simple as that

Huawei HMS core launched a new member conversion & retention prediction model
随机推荐
Remember to deploy selenium crawler on the server
Redis core article: the secret that can only be broken quickly
打新债证券开户安全吗
通过启牛学堂开的股票账户可以用吗?资金安全吗?
PAT B1076
Vulnhub range - darkhole 1
206. reverse linked list (insert, iteration and recursion)
8. iterators and generators
二、HikariCP獲取連接流程源碼分析二
Pta--7-20 exchange minimum and maximum (15 points)
Redis practice: smart use of data types to achieve 100 million level data statistics
在打新债开户证券安全吗?低佣金靠谱吗
Appearance of object attributes
Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
RPM package installation command
Curtain down and departure
2、 Hikaricp source code analysis of connection acquisition process II
Uni app through uni Navigateto failed to pass parameter (pass object)
The error log of vscode connecting to the server shows the problem of "insufficient permission". Directly use root to connect
Determine whether it is a web page opened on wechat