Giter Club home page Giter Club logo

fedkd's People

Contributors

wuch15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fedkd's Issues

IndexError: tuple index out of range:File "/data/liuqian/FedKD-main/model_bert.py", line 195, in forward word_emb = temp[3][self.nlayer]

1、运行run.py时,报错出现在 tuple index out of range:File "/data/liuqian/FedKD-main/model_bert.py", line 195, in forward word_emb = temp[3][self.nlayer] ;

2、使用的模型为bert-base-uncased,数据为MINDsmall_train;

3、因为temp的长度为3,最大索引为2,在计算 word_emb, word_emb2,word_att会报错tuple index out of range,是不是跟使用的模型有关,如果我使用的bert-base-uncased模型的话,这一块怎么取值?
print(len(temp))#len=3
word_emb = temp[3][self.nlayer]
word_emb2 = temp[3]
word_att=temp[4]

Questions about parameter updates

Thanks to the author for making the code open source. But there are some details about the code that I don't quite understand.

  1. latest_local_student_para, which is not the latest parameter, seems to have been assigned at the beginning and not updated.

FedKD/run.py

Line 131 in 6166696

latest_local_student_para=[{name:para.detach().cpu().numpy() for name,para in model.student_bert_models.named_parameters()} for model in local_models]

  1. The aggregate parameter is student_update. The gradient is the difference between the latest weight parameter and the previous weight parameter. But when update a local model parameter, this code replace it directly, right? (Could the gradient be replaced directly with a weight value?)

FedKD/run.py

Line 188 in 6166696

student_update[name]=local_models[i].student_bert_models.state_dict()[name].detach().cpu().numpy()-latest_local_student_para[i][name]

FedKD/run.py

Line 246 in 6166696

local_models[i].student_bert_models.state_dict()[name][:]=torch.FloatTensor(aggregated_para[name]).cuda()

I'm looking forward to your reply.

Train data problem

  1. In run.py line 119 the code got the dataloader , however in dataloader line 161 , I find that all train data's label are set to 0. And in model_bert.py line 525, all targets are used to train model. So I want to know if it is a mistake?
  2. MIND dataset is a recommendation task. However in run.py training process, I haven't find the use of behaviors.tsv but the only use of news.tsv. So I have the problem that what's the train target of the training process?

tnlrv3 problem

Thanks for such a wonderful code.
I have a probem about tnlrv3.
In code:
from tnlrv3.modeling import TuringNLRv3ForSequenceClassification
from tnlrv3.configuration_tnlrv3 import TuringNLRv3Config
from tnlrv3.tokenization_tnlrv3 import TuringNLRv3Tokenizer
In readme, I follow the descripion to find UniLM v2 in Microsoft, but I cannot find any codes includes the imported module above.
Could you please explain what exactly these three modules are imported or where should I go to find them?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.