当前位置:网站首页>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)边栏推荐
- Clickhouse disables automatic clearing of tables / columns, that is, disables TTL
- Automatic fitting when the applet reaches the top
- 2.3 partial sum of square and reciprocal sequences
- PAT B1056
- Is it safe to open a new bond securities account
- Vulnhub range the planes:earth
- Web container basic configuration
- 2.2 step tariff
- PAT B1057
- Impact of Huawei application transfer and application claim on user identification
猜你喜欢

ActiveMQ--CVE-2016-3088

LNMP compilation and installation

Wechat applet swiper simple local picture display appears large blank

<C>. Rolling phase division

2.3 partial sum of square and reciprocal sequences

The native JS mobile phone sends SMS cases. After clicking the button, the mobile phone number verification code is sent. The button needs to be disabled and re enabled after 60 seconds

H5 application conversion fast application

Bindgetuserinfo will not pop up

Wechat applet cloud function does not have dependency option installed

JS asynchronism (I. asynchronous concept, basic use of web worker)
随机推荐
From now on, I will blog my code
My official account writing experience sharing
PAT B1096
Appearance of object attributes
Dependency injection in PHP reflection implementation framework
I Space distributor
Go language installation and uninstallation
PAT B1081
201604-4 test title: Game (BFS search maze)
Yaml configuration
Redis high availability: do you call this the principle of master-slave architecture data synchronization?
Huawei HMS core launched a new member conversion & retention prediction model
2.3 partial sum of square and reciprocal sequences
Please do not call Page constructor in files
String since I can perform performance tuning, I can call an expert directly
Applet wx Request encapsulation
A necessary programming assistant for programmers! Smartcoder helps you easily integrate HMS core
Jsonp non homologous interaction (click trigger)
Uni app through uni Navigateto failed to pass parameter (pass object)
Processing method for uniapp or applet onload not receiving parameters