model.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:vsepp 作者: fartashf 项目源码 文件源码
def forward(self, images):
        """Extract image feature vectors."""
        features = self.cnn(images)

        # normalization in the image embedding space
        features = l2norm(features)

        # linear projection to the joint embedding space
        features = self.fc(features)

        # normalization in the joint embedding space
        if not self.no_imgnorm:
            features = l2norm(features)

        # take the absolute value of the embedding (used in order embeddings)
        if self.use_abs:
            features = torch.abs(features)

        return features
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号