pub trait AttackModel: Send + Sync {
// Required method
fn forward(&self, input: &[f64]) -> Vec<f64>;
// Provided method
fn input_gradient(&self, input: &[f64], output_grad: &[f64]) -> Vec<f64> { ... }
}Expand description
A model that can be attacked.
Implementors provide a forward pass; input_gradient has a default finite-
difference implementation that can be overridden for efficiency.