摘要: 集合{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 阅读(55) 评论(0) 推荐(0)
摘要: cp -r `ls |grep -v -E "random_result|log"|xargs` ../../Fl/V1 阅读全文
posted @ 2022-03-21 09:01 zae 阅读(131) 评论(0) 推荐(0)
摘要: 参考博客 阅读全文
posted @ 2022-02-23 16:46 zae 阅读(59) 评论(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 阅读(156) 评论(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 阅读(594) 评论(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 阅读(252) 评论(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 阅读(703) 评论(0) 推荐(0)
摘要: 取参数: g=model.named_parameters() parm={} for name,parameters in model.named_parameters(): print(name,':',parameters.size()) parm[name]=parameters.detac 阅读全文
posted @ 2022-02-22 11:00 zae 阅读(545) 评论(0) 推荐(0)
摘要: parser.add_argument("--flag", action="store_true", help="Run or not.") 当你不输入 --flag 的时候,默认为 False;输入 --flag 的时候,才会触发 True 值。【符合常理】 当然用方式,反过来也可以指定 acti 阅读全文
posted @ 2022-02-22 09:31 zae 阅读(971) 评论(0) 推荐(0)