Nomad
Nomad
> 1.你好,我想问一下,在P-tunning中,[Mask]在一众[unused]中得位置是怎么确定的?是人工选择的吗?如果不是的话,是根据什么方式确定的? > 2.原论文中写的当数据量比较少的时候用的anchor-word,比如预测“英国首都”,在几个[unused]中加一个[capital]效果会比较好,这个[capital]应该加在哪个位置是如何确定的呢? 不是作者哈,试着说一下自己的理解: 1. 这个项目中的prmopt没有使用[unused] token,这里的[Mask]就和manual prmopt的mask位置一致。你看到的可能是苏剑林大佬文章中用了unused token的setting,他的代码在这里:https://github.com/bojone/P-tuning 2. 这个项目中其实prompt中大部分的token都是anchor-word,具体到`PT_Fewshot/data_utils/task_pvp.py`中你可以看各个task的prompt。比如说Rte任务的prompt格式如下: https://github.com/THUDM/P-tuning/blob/368ab8561bab04b44010744a365124efaed6bf16/PT-Fewshot/data_utils/task_pvps.py#L288 它对应的`block_flag_a`是: https://github.com/THUDM/P-tuning/blob/368ab8561bab04b44010744a365124efaed6bf16/PT-Fewshot/data_utils/task_pvps.py#L290 其中第5个值为1,表示这个词是可以替换成LSTM embedding的,在这个prompt中对应`the`这个token。 其他的PVP同理,总之它目前的实现中基本除了少部分`block_flag==1`位置的token以外都是anchor token。 至于为什么这么选择,大概是因为这些token包含的语义信息比较少,替换掉也没事,效果稍微调一下也能上去……
> @Riroaki 可以倒是可以,不过最近经常加班,应该没时间改了,后续我看看吧。 感谢!matery主题很美哈哈 - 突然发现话好像没说清楚,就是遇到``这个标签的时候,停止截取; - 同时这个标签连同开头内容也按照原文的markdown渲染(保留换行、删除线等等)而不是提取文字。 辛苦啦
老哥,感谢!我用了你的代码,现在在msra数据集的句子长度截断了,但是训练时依然会报OOM,不知道你有没有遇到? ``` train:7026 train max_seq_len:387 train max_lex_num:233 train max_seq_lex:601 test max_seq_len:351 test max_lex_num:231 test max_seq_lex:572 loading vocabulary file /home/llq/.fastNLP/embedding/bert-chinese-wwm/vocab.txt Load pre-trained BERT parameters from file /home/llq/.fastNLP/embedding/bert-chinese-wwm/chinese_wwm_pytorch.bin. Start to generate word...
我设置了batch为2,梯度积累5步,可是中间还是炸了。。。
估计是测试的test_batch太大了(设置是10),debug发现是在测试爆的
> > 老哥,感谢!我用了你的代码,现在在msra数据集的句子长度截断了,但是训练时依然会报OOM,不知道你有没有遇到? > > ``` > > train:7026 > > train max_seq_len:387 > > train max_lex_num:233 > > train max_seq_lex:601 > > test max_seq_len:351 > > test max_lex_num:231 >...
Thanks for your attention! Here the block_flag==1 stands for replaceable tokens and 0 stands for unchanged tokens. In the method of our paper together with the P-Tuning method integrated in...
Same thoughts. And I think zipping arrays into lower dimensions and using smaller `input_dim` may help, as smaller dimensions increases the probability of collision, and therefore similar vectors are more...
> Same thoughts. > And I think zipping arrays into lower dimensions and using smaller `input_dim` may help, as smaller dimensions increases the probability of collision, and therefore similar vectors...