WenmuZhou / reprod_log

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问diff的计算是严格按照diff=(np.abs(data1) - np.abs(data2)).mean()来计算的吗

daidaiershidi opened this issue · comments

    diff_helper = ReprodDiffHelper()
    # 读取info
    torch_info = diff_helper.load_info('loss_torch.npy')
    paddle_info = diff_helper.load_info('loss_paddle.npy')
    # 比较info
    diff_helper.compare_info(torch_info, paddle_info)
    # 手动计算
    print('手动计算diff:', np.mean(np.abs(torch_info['stage_2:d']) - np.abs(paddle_info['stage_2:d'])))
    # 
    diff_helper.report(diff_method="mean", path='loss_diff.log')

手动计算diff: 9.908756e-10
[2022/01/07 07:54:06] root INFO: stage_2:d:
[2022/01/07 07:54:06] root INFO: mean diff: check passed: False, value: 0.1399555653333664

字典里其他的值我也有手动计算,结果也不一样,但没有这个例子差别这么大(check paessed true和false的区别)

ezoic increase your site revenue