KrumSimulation#
KrumSimulation.
- Reference:
Peva Blanchard, El Mahdi El Mhamdi, Rachid Guerraoui, and Julien Stainer. “Machine learning with adversaries: Byzantine tolerant gradient descent.” In Advances in Neural Information Processing Systems 30 (NIPS 2017).
One KrumSimulation instance = one (aggregator, attack, dataset, model)
configuration run over multiple synchronous rounds with no learning rate decay.
- class krum.simulations.centralised.krum_nips_2017.KrumSimulation(**kwargs: Any)[source]#
Bases:
CentralisedSimulationDistributed SGD simulation.
Compared to the ICML 2018
HiddenVulnerabilitySimulation, this variant:Uses a fixed learning rate (no scheduler;
lr_decay=None, the default inherited fromCentralisedSimulation).Reports misclassification error and cross-entropy loss on the test set.
- evaluate() tuple[float, float][source]#
Evaluate the model on the test set.
- Returns:
Tuple of `` (test_loss, test_accuracy)
- evaluate_train() float[source]#
Evaluate the model on the training set.
- Returns:
Training loss.
Note
Reads the full training set in a single
no_gradpass (self._full_loaderbatches the concatenation of every worker’s dataset at once). OK for the small datasets used by the bundled experiments (Spambase ≈ 4.5k rows); for larger datasets, sample a fixed-size subset instead.
See also
For the ICML 2018 counterpart, see HiddenVulnerabilitySimulation.