Skip to content

代码实现中关于自注意力的计算 #50

@fangxuehouwuming

Description

@fangxuehouwuming

作者您好!我在阅读代码的时候发现在文件 attention_control.py 的第50行有这么一句:
if attn.shape[1] <= (self.res // 16) ** 2: # avoid memory overhead
这是否意味着实现中只用了分辨率小于 14*14 (假设self.res=224)的自注意力图来算损失?除了减少计算量还有其他考量吗,我很好奇您是否做了一些消融实验来选择特定的自注意力层?如果我理解错了还请您指出,谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions