MINICPM-V2_6图像+文本得到embedding-代码解读 基于将不同长度的图片patch embedding通过resampler变换成固定长度的patch embedding,那这个patch embedding是怎么和文本embedding到一起的呢?本篇从此出发,一起来看一下吧。
MINICPM-V2_6之图像embedding的resampler-代码解读 既然是attention,那其中必然有位置embedding,这里使用的是ROPE,只是因为是2D,所以这里也要处理一下得到2D的位置embedding"""输入:embed_dim: 向量维度输出:demo:"""else:grid = np.meshgrid(grid_w, grid_h) # 生成网格,但是这里是w在前;torch.meshgrid是h在前grid = np.stack(grid, axis=0)# 在第0维拼接"""输入:embed_dim: 向量维度。
MINICPM-V2_6图像得到embedding-代码解读 通过阅读代码,找到MINICPM-V2_6由图片得到embedding(位置编码和像素编码)的过程,并将代码本地化,每个代码都有对应的输入和输出,并详细的介绍了2D位置编码得到的过程。
InferSent Supervised Learning of Universal Sentence Representations from Natural Language Inference DataGitHub论文目的NLP系统基于word embedding作为base features,却很少有成功的sentence embedding。本论文基于Stanford NLI数据得到好的sentence representations,也可以转换到其它数据集。相关工作word2vecgloveSkip
ERNIE-DOC ERNIE-DOC: A Retrospective Long-Document Modeling TransformerGitHub论文目的因为随着长度的增加,transformer的内存和时间消耗成倍增加,所以transformer不适合处理长文本。简单的截断文档或使用稀疏attention并不能解决这个问题,提出ERNIE-DOC:一种基于循环transformer的文档级语言预训练模型,由两种技术组成:retrospective feed mechanism(回溯) and the enhan
GATER Heterogeneous Graph Neural Networks for Keyphrase GenerationGitHub论文目的keyphrase generation(KG)同时预测present keyphrases和absent keyphrases,但是仅依靠source document会产生不可控和不准确的absent keyphrases。为了解决这个问题,本论文基于图从相关的参考文献中获取显式的信息,首先从预定义的索引中找到与source document相似的文档-关键词
HiDEC HIERARCHY DECODER IS ALL YOU NEED TO TEXT CLASSIFICATIONGitHub论文目的Hierarchical text classification (HTC) 会有数据不平衡和层级依赖的缺点,有local和global两种改进方向,hierarchy decoder (HiDEC)基于编码器、解码器的层次递归解码,The key idea of the HiDEC involves decoding a context matrix into a su
TRANS-ENCODER TRANS-ENCODER: UNSUPERVISED SENTENCE-PAIR MODELLING THROUGH SELF- AND MUTUAL-DISTILLATIONSGitHub论文目的sentence similarity and paraphrase identification 两句话进行对比有两种常见的方法: bi-encoders and cross-encoders。Bi-encoders产生固定维度的句子表达,效果不如cross-encoders好,cross-encode
Fast, Effective, and Self-Supervised:Mirror-BERT Fast, Effective, and Self-Supervised: Transforming Masked LanguageModels into Universal Lexical and Sentence Encoders论文目的没有经过特定任务微调的预训练MLMs对句子编码是无效的,本论文想基于自监督将MLMs在不引入新数据的前提下对句子编码。提出Mirror-BERT:简单、快速、有效,通过对字符串进行小的修改形成正样本进行微调,有些数据集上效果与sentence-bert可媲美相关
开源数据集 遇到哪个加哪个NLPSTSSTS中的训练、测试、验证集的数量,语义文本相似性基准数据集,常用于无监督模型训练的测试集,使用Spearman correlation作为评价指标。STS-B http://ixa2.si.ehu.eus/stswiki/index.php/STSbenchmarkmain-captionsMSRvid2012test00005.000A man with a hard hat is dancing.A man wearin
ESimCSE: Enhanced Sample Building Method for Contrastive Learning of Unsupervised Sentence Embedding 论文目的SimCSE 使用dropout作为数据增强的最小方法,因为transformer使用位置embedding,句子的长度信息会被编码到句子embedding中,所以unsup-SimCSE的正对包含相同的长度信息。所以unsup-SimCSE训练的正样本对估计是有偏的,会倾向于将有相同或类似长度的句子是相似的,通过统计观察,发现unsup-SimCSE的确有这个问题。为了缓解它,使用一个简单的重复操作来修改句子,然后将句子和修改后的句子输入transformer来得到正对,且从CV中引入momen
R-Drop: Regularized Dropout for Neural Networks 论文目的dropout会给训练和测试的过程中带来不一致,regularize dropout 简单的一致性训练策略,迫使dropout产生的子模型输出分布一致,这是通过约束每个样本两个子模型的输出的双向KL散度来达到的。在 neural machine translation, abstractive summarization, language understanding, language modeling, and image classification五个任务上做了实验。方法R-Drop
SimCSE: Simple Contrastive Learning of Sentence Embeddings 论文目的SimCSE:simple contrastive sentence embedding framework首先提出一种无监督的方法,仅使用dropout作为噪声,进行对比训练。与有监督的方法效果类似,dropout充当了最小的数据增强的方法,删除它模型会崩溃。然后提出一种有监督的方法,使用自然语言推理(NLI)中的蕴含作为正对、矛盾作为负例,在STS任务上评估SimCSE,在无监督和有监督的任务上都有提升。还在理论和试验上证明了对比学习目标将预训练嵌入的各向异性空间正则化,使其更加均匀。
Simple Contrastive Representation Adversarial Learning for NLP Tasks 这里写自定义目录标题论文目的相关工作contrastive learningAdversarial Training and Adversarial Attack本文方法Adversarial Training And Adversarial Attack MethodsSelf-supervised Contrastive LearningSupervised Contrastive Adversarial LearningUnsupervised Contrastive Adversarial Lear