A Little Is Enough Function
Details about the A Little Is Enough attack method.
def a_little_is_enough(honest_vectors, attack_factor=3, negative=False):
...
return stacked_vectors.mean(dim=0).add(attack_vector, alpha=attack_factor)
Inputs
honest_vectors: list - List of honest vectors for processing.
attack_factor: int - Factor controlling the magnitude of the attack vector.
negative: bool - Controls the sign of the attack factor.
Outputs
torch.Tensor - The processed Tensor after applying the A Little Is Enough attack.