
deeplearning
文章平均质量分 69
Mark周末
这个作者很懒,什么都没留下…
展开
-
Transfromers的tokenizer
获取tokenizer对象from transformers import BertTokenizertokenizer = BertTokenizer.from_pretrained('bert-base-chinese')encode的几种方法对比总结:tokenizer默认和encode_plus含义一样,即加好了token_type_ids,mask等label,类似于dict一样访问这个函数tokenizer.encode 只是把 input_ids的结果拿下来,然后后面的属.原创 2021-03-23 15:08:28 · 1289 阅读 · 0 评论 -
LG-FedAvg略读
Think Locally, Act Globally:Federated Learning with Local and Global Representations略读最大的贡献:server为part(后面)模型,只做汇总,不做训练。client节点分成前后两个part,前后区分以server为区分点,只需要将后部分的parameter传给server(communication cost变少)具体算法见下图:...原创 2020-12-04 15:01:40 · 1753 阅读 · 0 评论 -
LotteryFL阅读笔记
LotteryFL: Personalized and Communication-Efficient Federated Learning with Lottery Ticket Hypothesis on Non-IID Datasets阅读笔记针对FL的问题:1. statistical heterogeneity2. communication efficiency主要优化策略:使用Lottery Ticket hypothesis,因为worker上面只是子网络,所以通讯量下降了。因为w原创 2020-12-04 11:16:21 · 657 阅读 · 0 评论 -
Pytorch笔记:torch.eval使用方法
训练完train_datasets之后,model要来测试样本了。在model(test_datasets)之前,需要加上model.eval(). 否则的话,有输入数据,即使不训练,它也会改变权值。(这样就导致测试结果不对)这是model中含有batch normalization层所带来的的性质。...原创 2020-06-05 10:15:24 · 5426 阅读 · 0 评论 -
RuntimeError: The size of tensor a (4) must match the size of tensor b (3)
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0读取格式不对改正方法:image = Image.open(image_path).convert('RGB')需要转RGB模式原创 2020-06-04 00:42:53 · 7163 阅读 · 4 评论