MART
MART copied to clipboard
Add tests for Adversary at arbitrary layer in model.
Right now, the Adversary
checks whether model
is present in order to determine when to attack:
https://github.com/IntelLabs/MART/blob/a2f936e5c4486e179fd8e47d03301b0f8bd16e9a/mart/attack/adversary.py#L314
However, because an Adversary
can live at any layer, it should really check whether sequence
is present:
https://github.com/IntelLabs/MART/blob/a2f936e5c4486e179fd8e47d03301b0f8bd16e9a/mart/nn/nn.py#L115
The reason is that the sequence
represents the "continuation" of the model at the point where the Adversary
lives in the model. Meaning that the Adversary
can call the sequence
to get a loss. Calling the model may be incorrect depending upon at which layer of model the Adversary
lives.