FAT

Implementation of the FAT [FAT20] algorithm.

References

[FAT20]

Giulio Zizzo, Ambrish Rawat, Mathieu Sinn, Beat Buesser. FAT: Federated Adversarial Training. In SpicyFL@NeurIPS (2020). URL: https://arxiv.org/abs/2012.01791

Classes included in fluke.algorithms.fat

Classes

class fluke.algorithms.fat.FATClient(index: int, train_set: FastDataLoader, test_set: FastDataLoader, optimizer_cfg: OptimizerConfigurator, loss_fn: Module, local_epochs: int, fine_tuning_epochs: int = 0, clipping: float = 0, eps: float = 0.1, alpha: float = 0.00784313725490196, adv_iters: int = 10, k_prop: float = 1.0, **kwargs: dict[str, Any])[source]

Bases: Client

generate_adversarial(model: Module, inputs: Tensor, targets: Tensor, eps: float = 0.1, alpha: float = 0.00784313725490196, iters: int = 10) Tensor[source]

Generates adversarial examples using Projected Gradient Descent (PGD).

Parameters:
  • model (nn.Module) – The neural network model.

  • inputs (Tensor) – Input samples.

  • targets (Tensor) – True labels for the inputs.

  • alpha (float) – Step size for each iteration.

  • iters (int) – Number of attack iterations.

Returns:

Adversarial examples.

Return type:

Tensor

class fluke.algorithms.fat.FAT(n_clients: int, data_splitter: DataSplitter, hyper_params: DDict | dict[str, Any], **kwargs: dict[str, Any])[source]

Bases: CentralizedFL