Closed swbyy closed 2 years ago
Hi, thank you for pointing out this issue. First, the variable num'' is used for controlling the number of clients used for model training in a single federated training round. Second, the variable
ratio'' is designed for computing the variable num'', i.e., num = ratio*number_of_all_clients. In our codes, we forget to compute the variable
num'' via the variable ratio'', and directly set the variable
num'' to 6, which confuses you. We will fix this issue.
Question from swbyy:
Thanks for your answers, sorry to bother you again, but I have successfully run your code and adjusted parameters according to those belonging to the paper. I have got 70+ outputs, but the results are not as good as in the paper which are almost all around (0.5030970471878436, 0.21842349985408516, 0.22200034188572945, 0.2848765577690094).Is this because the model has not yet converged? Or after how many times can the output effect reach what is described in the paper?
What‘s more, I discovered that in the last cell of Ecample.ipynb, lambd isn't used in def fed_single_update, did you misspell lambd as lr in "loss = fed_single_update(model,doc_encoder,user_encoder,ratio,lr,get_user_data,train_uid_table)"? And, in def fed_single_update I don't see a statement about updating the gradient g.
I have checked my codes again. I found that the 4-th parameter passed to the function fed_single_update'' should be the parameter
lambd'' instead of the parameter lr'' . The parameter
lambd'' controls the intensity of the LDP noise, and this mistake will perturb the local model prediction with strong noise, which seriously hurt the model performance. In fact, the model can converge to 65 AUC after around 1000 rounds. I will fix this issue now.
In addition, since averaging local models and averaging local gradients are is mathematically equivalent, in our codes we did not explicitly compute the gradient. I will improve our codes according to your suggestions.
In the last cell of Ecample.ipynb, where do you use ratio? I don't find anywhere in your model where this parameter is used. What's more, what is the variable named num used for?