File size: 440 Bytes
4f5540c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import torch

def epistemic(outdict):
    '''
    Epistemic uncertainty given the output of evidential model
    '''
    beta = outdict['beta']
    alpha = outdict['alpha']
    v = outdict['v']

    return (beta / (v * (alpha - 1))).item()

def aleatoric(outdict):
    '''
    Aleatoric uncertainty given the output of evidential model
    '''
    beta = outdict['beta']
    alpha = outdict['alpha']

    return (beta / (alpha - 1)).item()