def acc_segmentation(input: torch.cuda.FloatTensor, targs: torch.cuda.IntTensor, rm_bknd=True): """The intent of this metric is to have a metric where it's easy to understand the implications of the value it outputs since the output value of mAP IoU is more difficult to understand intuitively.""" _n = targs.shape[0] input = input.argmax(dim=1).view(_n, -1) targs = targs.view(_n, -1) return (input == targs).float().mean()
def accuracy(input: torch.cuda.FloatTensor, targs: torch.cuda.LongTensor): _n = targs.shape[0] input = input.argmax(dim=1).view(_n, -1) targs = targs.view(_n, -1) return (input == targs).float().mean()