utils/data_utils.py
def shift(model_output, gt, grad=False):
    """
    Shift model output to have the same mean of gt
    :param model_output:
    :param gt:
    :param grad:
    :return:
    """
    if not grad:
        mean_diff = torch.mean(model_output, dim=[-2]).detach() - torch.mean(gt, dim=[-2])
    else:
        mean_diff = torch.mean(model_output, dim=[-3, -2]).detach() - torch.mean(gt, dim=[-3, -2])
    return model_output - mean_diff

    Shift model output to have the same mean of gt
    :param model_output:
    :param gt:
    :param grad:
    :return:
    
Shift model output to have the same mean of gt
Shift model output to have the same mean of gt
def shift(model_output, gt, grad=False):
    if not grad:
        mean_diff = torch.mean(model_output, dim=[-2]).detach() - torch.mean(gt, dim=[-2])
    else:
        mean_diff = torch.mean(model_output, dim=[-3, -2]).detach() - torch.mean(gt, dim=[-3, -2])
    return model_output - mean_diff
def shift ( model_output , gt , grad = False ) : if not grad : mean_diff = torch . mean ( model_output , dim = [ - 2 ] ) . detach ( ) - torch . mean ( gt , dim = [ - 2 ] ) else : mean_diff = torch . mean ( model_output , dim = [ - 3 , - 2 ] ) . detach ( ) - torch . mean ( gt , dim = [ - 3 , - 2 ] ) return model_output - mean_diff
Shift model output to have the same mean of gt
Shift model output to have the same mean of gt
"""
    Shift model output to have the same mean of gt
    :param model_output:
    :param gt:
    :param grad:
    :return:
    """
None
model_output
None
gt
None
grad
None