plm-nlp-code icon indicating copy to clipboard operation
plm-nlp-code copied to clipboard

Results 20 plm-nlp-code issues
Sort by recently updated
recently updated
newest added

如标题所示,调整了batch_size=32之后在3060的机器上运行本代码仍然会导致显存溢出,请问有无优化的方法呢?谢谢 ![图片](https://user-images.githubusercontent.com/20312824/169194003-641ca06f-81a5-4301-a6c7-5d98371716a2.png)

画图横坐标范围代码中为: plt.xlim(0, 0.6) 实际分解输出没在该范围,同时对应书中所给图,应改为: plt.xlim(-0.5, 0)

您好,我发现第七章代码中有处地方能够优化一下。 tokenizer函数中,可以去掉padding='max_length',浪费计算资源。transformer提供的Trainer构造时的data_collator参数默认采用了动态补全的方法,按照batch进行补全,能够节省计算资源。 在我的CPU上跑,时间从36小时变为2小时(没跑完,进度条给的预估时间)

line 28 seems to be typo. Shouldn't `label_ids.append(label[word_idx])` be `label_ids.append(label[previous_word_idx ])`?

第5章中 在Class GloveDataset: def collate_fn(self, examples) 但是全文没有一个地方有examples

![image](https://user-images.githubusercontent.com/19852303/141640749-267438ec-69ca-46d9-ae84-d95120a8e2bd.png) 于此同时,17页倒数第三行,只需要输入共现矩阵一句与代码不一致,共现矩阵是M,M_pmi是依据共现矩阵计算点互信息所得到的点互信息矩阵

调整坐标后的输出和书中的不一致 ![image](https://user-images.githubusercontent.com/19852303/141642580-f41c7eb5-5a8b-4b57-b730-920a0573605a.png)

如题,直接运行会报错。 `RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor` 需要把'lengths'放到cpu中去,才可以。 将第40行的 `x_pack = pack_padded_sequence(embeddings, lengths, batch_first=True, enforce_sorted=False)` 改为 `x_pack = pack_padded_sequence(embeddings, lengths.cpu(),...