advsecurenet.attacks.attacker package


advsecurenet.attacks.attacker.attacker module

class advsecurenet.attacks.attacker.attacker.Attacker(config: AttackerConfig, **kwargs)

Bases: object

Attacker module is specialized module for attacking a model.

execute()

Entry point for the attacker module. This function executes the attack.

advsecurenet.attacks.attacker.ddp_attacker module

class advsecurenet.attacks.attacker.ddp_attacker.DDPAttacker(config: AttackerConfig, rank: int, world_size: int)

Bases: DDPBaseTask, Attacker

DDPAttacker module is specialized module for attacking a model using DistributedDataParallel in a multi-GPU setting.

Parameters:
  • config (AttackerConfig) – The attacker config.

  • rank (int) – The rank of the current process.

  • world_size (int) – The total number of processes.

execute()

Entry point for the attacker module. This function executes the attack.

static gather_results(world_size) list

Static method to gather results from all the processes. Each process stores the results in a temporary file. The results are gathered and returned.

Parameters:

world_size (int) – The total number of processes.

Returns:

The gathered adversarial images.

Return type:

list