将 Tanh 激活函数应用于 ViT - MLP 头

作者: joeycouse创建于 2023年2月21日更新于 2025年1月4日

在文档中写道: "为了尽可能接近原始的 Transformer 模型,我们使用了一个额外的 [class] 标记,将其作为图像表示。该标记的输出然后通过一个带有单隐藏层中的 Tanh 非线性的小型多层感知器 (MLP) 转换为类别预测。" https://GitHub.com/lucidrains/vit-pytorch/blob/5699ed7d139062020d1394f0e85a07f706c87c09/vit_pytorch/vit.py#L110-L113

内容来源: lucidrains/vit-pytorch