diff --git a/tests/attacks/inference/attribute_inference/test_black_box.py b/tests/attacks/inference/attribute_inference/test_black_box.py index 15b526caa7..fb16287c05 100644 --- a/tests/attacks/inference/attribute_inference/test_black_box.py +++ b/tests/attacks/inference/attribute_inference/test_black_box.py @@ -86,8 +86,8 @@ def transform_feature(x): # check accuracy train_acc = np.sum(inferred_train == x_train_feature.reshape(1, -1)) / len(inferred_train) test_acc = np.sum(inferred_test == x_test_feature.reshape(1, -1)) / len(inferred_test) - assert pytest.approx(0.8285, abs=0.3) == train_acc - assert pytest.approx(0.8888, abs=0.3) == test_acc + assert pytest.approx(0.8285, abs=0.35) == train_acc + assert pytest.approx(0.8888, abs=0.35) == test_acc print(model_type, train_acc, test_acc) except ARTTestException as e: @@ -184,8 +184,8 @@ def transform_feature(x): # check accuracy train_acc = np.sum(inferred_train == x_train_feature.reshape(1, -1)) / len(inferred_train) test_acc = np.sum(inferred_test == x_test_feature.reshape(1, -1)) / len(inferred_test) - assert pytest.approx(0.8285, abs=0.3) == train_acc - assert pytest.approx(0.8888, abs=0.3) == test_acc + assert pytest.approx(0.8285, abs=0.35) == train_acc + assert pytest.approx(0.8888, abs=0.35) == test_acc print(model_type, train_acc, test_acc) except ARTTestException as e: @@ -236,8 +236,8 @@ def transform_feature(x): # check accuracy train_acc = np.sum(inferred_train == x_train_feature.reshape(1, -1)) / len(inferred_train) test_acc = np.sum(inferred_test == x_test_feature.reshape(1, -1)) / len(inferred_test) - assert pytest.approx(0.8285, abs=0.3) == train_acc - assert pytest.approx(0.8888, abs=0.3) == test_acc + assert pytest.approx(0.8285, abs=0.35) == train_acc + assert pytest.approx(0.8888, abs=0.35) == test_acc print(model_type, train_acc, test_acc) except ARTTestException as e: @@ -286,8 +286,8 @@ def transform_feature(x): # check accuracy train_acc = np.sum(inferred_train == x_train_feature.reshape(1, -1)) / len(inferred_train) test_acc = np.sum(inferred_test == x_test_feature.reshape(1, -1)) / len(inferred_test) - assert pytest.approx(0.8285, abs=0.3) == train_acc - assert pytest.approx(0.8888, abs=0.3) == test_acc + assert pytest.approx(0.8285, abs=0.35) == train_acc + assert pytest.approx(0.8888, abs=0.35) == test_acc print(model_type, train_acc, test_acc) except ARTTestException as e: diff --git a/utils/resources/create_model_weights.py b/utils/resources/create_model_weights.py index 2c1c6c0acb..354ca55fc0 100644 --- a/utils/resources/create_model_weights.py +++ b/utils/resources/create_model_weights.py @@ -21,7 +21,6 @@ import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPooling2D -import sklearn from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, LinearSVC from sklearn.tree import DecisionTreeClassifier, ExtraTreeClassifier