def METHOD_NAME(self, opt, cur_params, init_params, weight=0):
    if weight == 0:
        weight = opt.ratio
    grad_dict = {}
    for k in cur_params.keys():
        scale = 1.0 / opt.local_normalizing_vec
        cum_grad = init_params[k] - cur_params[k]
        cum_grad.mul_(weight * scale)
        grad_dict[k] = cum_grad
    return grad_dict