KaihuaTang / Long-Tailed-Recognition.pytorch

[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS). It is also a PyTorch implementation of the NeurIPS 2020 paper 'Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal Effect'.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

关于统计移动平均特征的代码问题

Kittywyk opened this issue · comments

您好,首先非常感谢您solid的工作。

但在我看具体代码时,有一些问题想要请教:

在 lvis1.0\mmdet\models\roi_heads\bbox_heads\convfc_bbox_head.py 文件中的 update_embed 函数里:

        if self.training:
            # remove background
            with torch.no_grad():
                fg_target = targets[gt_label > 0].clone().detach().mean(0, keepdim=True)   
                self.causal_embed = self.MU * self.causal_embed + fg_target    
        return

就我理解而言,这里是给滑动平均值加上了特征图的(fg_target)的数值,而非梯度值,与下图式中的 g_t 不符。请问是我对代码的理解有误吗?可否指正一下,非常感谢!
image

我觉得这里的causal_embed 应该对应为论文的
image
你再看看论文