XPixelGroup/ClassSR

计算FLOPs相关

aoaforever opened this issue · 1 comments

您好!我有两个问题需要请教:

  1. 请问代码里为什么需要除以sum(num_ress) ?
  2. 为什么对FRCNN网络的flops还需要加上7.4 ?
    期待您的解答,谢谢!!
def cal_FLOPs(which_model,num_ress):
    if which_model =='classSR_3class_fsrcnn_net':
        flops = ((141 * num_ress[0] + 304 * num_ress[1] + 468 * num_ress[2]) / sum(num_ress))+7.4
        percent=flops/468
    elif which_model=='classSR_3class_carn':
        flops = (0.38 * num_ress[0] + 0.77 * num_ress[1] + 1.15 * num_ress[2]) / sum(num_ress)
        percent = flops / 1.15
    elif which_model=='classSR_3class_srresnet':
        flops = (1.66 * num_ress[0] + 3.44 * num_ress[1] + 5.20 * num_ress[2]) / sum(num_ress)
        percent = flops / 5.20
    elif which_model=='classSR_3class_rcan':
        flops = (10.33 * num_ress[0] + 19.90 * num_ress[1] + 32.60 * num_ress[2]) / sum(num_ress)
        percent = flops / 32.60
    return flops,percent