AdversarialAttackBase<T, TInput, TOutput>
Base Classes · AiDotNet.AdversarialRobustness.Attacks
Base class for adversarial attack implementations.
Implements: IAdversarialAttack<T, TInput, TOutput>, IModelShape
Known derived types: AutoAttack<T, TInput, TOutput>, CWAttack<T, TInput, TOutput>, FGSMAttack<T, TInput, TOutput>, PGDAttack<T, TInput, TOutput>, ViTAdversarialAttack<T, TInput, TOutput>
For Beginners
This provides AI safety functionality. Default values follow the original paper settings.
Methods
| Method | Summary |
|---|---|
AdversarialAttackOptions<T> GetOptions() |
|
DynamicShapeInfo GetDynamicShapeInfo() |
|
TInput CalculatePerturbation(TInput original, TInput adversarial) |
|
TInput GenerateAdversarialExample(TInput input, TOutput trueLabel, IFullModel<T, TInput, TOutput> targetModel) |
|
TInput[] GenerateAdversarialBatch(TInput[] inputs, TOutput[] trueLabels, IFullModel<T, TInput, TOutput> targetModel) |
|
byte[] Serialize() |
|
int[] GetInputShape() |
Returns the input shape for this attack configuration. |
int[] GetOutputShape() |
Returns the output shape for this attack configuration. |
void Deserialize(byte[] data) |
|
void LoadModel(string filePath) |
|
void Reset() |
|
void SaveModel(string filePath) |