Security Metrics

class perceptron.benchmarks.CarliniWagnerL2Metric(model=None, criterion=None, distance=<class 'perceptron.utils.distances.MeanSquaredDistance'>, threshold=None)[source]

The L2 version of C&W attack.

static lp_distance_and_grad(reference, other, span)[source]

Calculate L2 distance and gradient.

class perceptron.benchmarks.CarliniWagnerLinfMetric(model=None, criterion=None, distance=<class 'perceptron.utils.distances.MeanSquaredDistance'>, threshold=None)[source]

The L_inf version of C&W attack.

static lp_distance_and_grad(reference, other, span)[source]

Calculate L2 distance and gradient.