摘要: 知乎 cat /usr/local/cuda/version.txt # 显示结果:CUDA Version 10.0.130 # CUDA 10.0 conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorc 阅读全文
posted @ 2021-11-23 10:42 zae 阅读(2289) 评论(0) 推荐(0) 编辑
摘要: 软件工具备份 latex画表格: https://www.latex-tables.com/ 阅读全文
posted @ 2023-05-08 12:16 zae 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 信息量 熵:对所有可能事件所带来的信息量求期望 交叉熵:衡量两个分布更相似否?(在大小上,类似于点积) 它主要刻画的是实际输出(概率)与期望输出(概率)的距离,也就是交叉熵的值越小,两个概率分布就越接近。 参考文献 引言 在使用pytorch深度学习框架,计算损失函数的时候经常会遇到这么一个函数: 阅读全文
posted @ 2022-10-09 21:11 zae 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 集合{ri}表示索引集合,i从0到n。 chrome-extension://ikhdkkncnoglghljlkmcimlnlhkeamad/pdf-viewer/web/viewer.html?file=https%3A%2F%2Faclanthology.org%2F2022.acl-long 阅读全文
posted @ 2022-10-09 20:48 zae 阅读(21) 评论(0) 推荐(0) 编辑
摘要: cp -r `ls |grep -v -E "random_result|log"|xargs` ../../Fl/V1 阅读全文
posted @ 2022-03-21 09:01 zae 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 参考博客 阅读全文
posted @ 2022-02-23 16:46 zae 阅读(51) 评论(0) 推荐(0) 编辑
摘要: csdn CrossEntropyLoss 等价于 softmax+log+NLLLoss LogSoftmax等价于softmax+log # 首先定义该类 loss = torch.nn.CrossEntropyLoss() #然后传参进去 loss(input, target) input维度 阅读全文
posted @ 2022-02-23 00:15 zae 阅读(127) 评论(0) 推荐(0) 编辑
摘要: label_to_id: B-LOC 0 B-ORG 1 B-PER 2 I-LOC 3 I-ORG 4 I-PER 5 O 6 dict->txt with open('data/label_dict.txt', 'w') as dict_f: for k, v in label_to_id.it 阅读全文
posted @ 2022-02-22 22:57 zae 阅读(497) 评论(0) 推荐(0) 编辑
摘要: logit[2,3] tensor(0.6992, device='cuda:0', grad_fn=<SelectBackward>) logit[[2,3]] tensor([[ 0.0344, -0.3932, -0.1510, 0.6992, -0.1125, 0.1510, -0.1140 阅读全文
posted @ 2022-02-22 22:37 zae 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 讲解 对比学习论文中出现: # compute logits # Einstein sum is more intuitive # positive logits: Nx1 l_pos = torch.einsum('nc,nc->n', [q, k]).unsqueeze(-1) # negati 阅读全文
posted @ 2022-02-22 20:27 zae 阅读(639) 评论(0) 推荐(0) 编辑