You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I ran Mean under the previous version of the signflipping attack, the attack was very effective. The accuracy of the global model aggregated by Mean is only 10%. Here is the code for the previous signflipping attack.
class SignflippingClient(ByzantineClient):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def local_training(self, data_batches):
for data, target in data_batches:
data, target = data.to(self.device), target.to(self.device)
data, target = self.on_train_batch_begin(data=data, target=target)
self.optimizer.zero_grad()
output = self.model(data)
loss = torch.clamp(self.loss_func(output, target), 0, 1e5)
loss.backward()
for name, p in self.model.named_parameters():
p.grad.data = -p.grad.data
self.optimizer.step()
But when I am running the signflipping attack on the current version, mean is convergent. I'm not sure what the problem is.
class SignFlipAdversary(Adversary):
def on_algorithm_start(self, algorithm: Algorithm):
class SignFlipCallback(ClientCallback):
def on_backward_end(self, task):
model = task.model
for _, para in model.named_parameters():
para.grad.data = -para.grad.data
for client in self.clients:
client.to_malicious(callbacks_cls=SignFlipCallback, local_training=True)
My guess is that the current version of signflipping was written incorrectly, and it should have inverted the sign of the gradient for all malicious users by def on_local_round_end().
The text was updated successfully, but these errors were encountered:
When I ran Mean under the previous version of the signflipping attack, the attack was very effective. The accuracy of the global model aggregated by Mean is only 10%. Here is the code for the previous signflipping attack.
But when I am running the signflipping attack on the current version, mean is convergent. I'm not sure what the problem is.
My config is
My guess is that the current version of signflipping was written incorrectly, and it should have inverted the sign of the gradient for all malicious users by
def on_local_round_end()
.The text was updated successfully, but these errors were encountered: