2525from art .estimators .classification .keras import KerasClassifier
2626from art .defences .preprocessor import FeatureSqueezing
2727from art .utils import load_dataset , get_labels_np_array
28- from art .estimators .classification .query_efficient_bb import QueryEfficientBBGradientEstimation
28+ from art .estimators .classification .query_efficient_bb import QueryEfficientGradientEstimationClassifier
2929
3030from tests .utils import master_seed , get_image_classifier_kr , get_tabular_classifier_kr
3131
@@ -57,7 +57,9 @@ def test_without_defences(self):
5757 (x_train , y_train ), (x_test , y_test ) = self .mnist
5858
5959 # Get the ready-trained Keras model and wrap it in query efficient gradient estimator
60- classifier = QueryEfficientBBGradientEstimation (self .classifier_k , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
60+ classifier = QueryEfficientGradientEstimationClassifier (
61+ self .classifier_k , 20 , 1 / 64.0 , round_samples = 1 / 255.0
62+ )
6163
6264 attack = FastGradientMethod (classifier , eps = 1 )
6365 x_train_adv = attack .generate (x_train )
@@ -81,7 +83,7 @@ def test_with_defences(self):
8183 classifier = KerasClassifier (model = model , clip_values = (0 , 1 ), preprocessing_defences = fs )
8284
8385 # Create the classifier
84- classifier = QueryEfficientBBGradientEstimation (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
86+ classifier = QueryEfficientGradientEstimationClassifier (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
8587
8688 attack = FastGradientMethod (classifier , eps = 1 )
8789 x_train_adv = attack .generate (x_train )
@@ -111,7 +113,7 @@ def test_iris_clipped(self):
111113 (_ , _ ), (x_test , y_test ) = self .iris
112114
113115 classifier = get_tabular_classifier_kr ()
114- classifier = QueryEfficientBBGradientEstimation (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
116+ classifier = QueryEfficientGradientEstimationClassifier (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
115117
116118 # Test untargeted attack
117119 attack = FastGradientMethod (classifier , eps = 0.1 )
@@ -129,7 +131,7 @@ def test_iris_unbounded(self):
129131
130132 # Recreate a classifier without clip values
131133 classifier = KerasClassifier (model = classifier ._model , use_logits = False , channels_first = True )
132- classifier = QueryEfficientBBGradientEstimation (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
134+ classifier = QueryEfficientGradientEstimationClassifier (classifier , 20 , 1 / 64.0 , round_samples = 1 / 255.0 )
133135 attack = FastGradientMethod (classifier , eps = 1 )
134136 x_test_adv = attack .generate (x_test )
135137 self .assertFalse ((x_test == x_test_adv ).all ())
0 commit comments