INNER CODE UNIT · Python

get_loss

nv-tlabs/GSCNN · loss.py:14

def get_loss(args):
    '''
    Get the criterion based on the loss function
    args: 
    return: criterion
    '''
    
    if args.img_wt_loss:
        criterion = ImageBasedCrossEntropyLoss2d(
            classes=args.dataset_cls.num_classes, size_average=True,
            ignore_index=args.dataset_cls.ignore_label, 
            upper_bound=args.wt_bound).cuda()
    elif args.joint_edgeseg_loss:
        criterion = JointEdgeSegLoss(classes=args.dataset_cls.num_classes,
           ignore_index=args.dataset_cls.ignore_label, upper_bound=args.wt_bound,
           edge_weight=args.edge_weight, seg_weight=args.seg_weight, att_weight=args.att_weight, dual_weight=args.dual_weight).cuda()

    else:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…