Skip to content

Commit 33efa3e

Browse files
committed
Fix dependencies
Signed-off-by: Beat Buesser <[email protected]>
1 parent b63c39c commit 33efa3e

File tree

3 files changed

+45
-28
lines changed

3 files changed

+45
-28
lines changed

.github/actions/goturn/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Get base image
2-
FROM python:3.8.19-slim-bullseye
2+
FROM python:3.8.19-slim-bookworm
3+
4+
ENV MONO_TLS_PROVIDER=legacy
35

46
# Install system wide software
57
RUN apt-get update \

.github/workflows/ci-goturn.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
test_pytorch_goturn:
2626
name: PyTorchGoturn
2727
runs-on: ubuntu-latest
28-
container: adversarialrobustnesstoolbox/art_testing_envs:goturn
28+
container: bbuesser/art_testing_env_goturn:latest
2929
steps:
3030
- name: Checkout Repo
3131
uses: actions/checkout@v4

tests/estimators/classification/test_scikitlearn.py

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_type(self):
149149

150150
def test_predict(self):
151151
y_predicted = self.classifier.predict(self.x_test_iris[0:1])
152-
y_expected = np.asarray([[3.07686594e-16, 2.23540978e-02, 9.77645902e-01]])
152+
y_expected = np.asarray([[0.25544427, 0.35099888, 0.39355685]])
153153
np.testing.assert_array_almost_equal(y_predicted, y_expected, decimal=4)
154154

155155
def test_save(self):
@@ -298,9 +298,9 @@ def test_class_gradient_none_1(self):
298298
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=None)
299299
grad_expected = [
300300
[
301-
[-1.98021257, 1.35627806, -6.28222561, -2.60076308],
302-
[-0.56322294, -0.70427608, -0.98874801, -0.67053026],
303-
[0.6508137, 0.26377308, 1.54522324, 0.80972391],
301+
[-1.97804999, 1.35988402, -6.28209543, -2.59983373],
302+
[-0.56164223, -0.70078993, -0.98865014, -0.66950917],
303+
[0.64962, 0.2610305, 1.54549754, 0.80910802],
304304
]
305305
]
306306
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=3)
@@ -309,45 +309,60 @@ def test_class_gradient_none_2(self):
309309
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:2], label=None)
310310
grad_expected = [
311311
[
312-
[-1.98021257, 1.35627806, -6.28222561, -2.60076308],
313-
[-0.56322294, -0.70427608, -0.98874801, -0.67053026],
314-
[0.6508137, 0.26377308, 1.54522324, 0.80972391],
312+
[
313+
-1.97804999,
314+
1.35988402,
315+
-6.28209543,
316+
-2.59983397,
317+
],
318+
[
319+
-0.56164235,
320+
-0.70078993,
321+
-0.98865038,
322+
-0.66950929,
323+
],
324+
[
325+
0.64961988,
326+
0.26103044,
327+
1.5454973,
328+
0.8091079,
329+
],
315330
],
316331
[
317-
[-1.92227495, 1.34355378, -6.11815596, -2.52638054],
318-
[-0.50528532, -0.71700042, -0.82467848, -0.59614766],
319-
[0.70875132, 0.25104877, 1.70929277, 0.88410652],
332+
[-1.9202075, 1.34698176, -6.1180439, -2.5255065],
333+
[-0.50379974, -0.71369207, -0.82459873, -0.59518182],
334+
[0.70746249, 0.24812828, 1.70954895, 0.88343531],
320335
],
321336
]
322337
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=3)
323338

324339
def test_class_gradient_int_1(self):
325340
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=1)
326-
grad_expected = [[[-0.56317311, -0.70493763, -0.98908609, -0.67106276]]]
341+
grad_expected = [[[-0.56164223, -0.70078993, -0.98865014, -0.66950917]]]
327342

328343
for i_shape in range(4):
329344
self.assertAlmostEqual(grad_predicted[0, 0, i_shape], grad_expected[0][0][i_shape], 3)
330345

331346
def test_class_gradient_int_2(self):
332347
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:2], label=1)
333348
grad_expected = [
334-
[[-0.56317306, -0.70493776, -0.98908573, -0.67106259]],
335-
[[-0.50522697, -0.71762568, -0.82497531, -0.5966416]],
349+
[[-0.56164235, -0.70078993, -0.98865038, -0.66950929]],
350+
[[-0.50379974, -0.71369207, -0.82459873, -0.59518182]],
336351
]
337352
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
338353

339354
def test_class_gradient_list_1(self):
340355
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=[1])
341-
grad_expected = [[[-0.56317311, -0.70493763, -0.98874801, -0.67106276]]]
356+
grad_expected = [[[-0.56164223, -0.70078993, -0.98865014, -0.66950917]]]
342357

343358
for i_shape in range(4):
344359
self.assertAlmostEqual(grad_predicted[0, 0, i_shape], grad_expected[0][0][i_shape], 3)
345360

346361
def test_class_gradient_list_2(self):
347362
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:2], label=[1, 2])
348363
grad_expected = [
349-
[[-0.56317306, -0.70493776, -0.98908573, -0.67106259]],
350-
[[0.70866591, 0.25158876, 1.70947325, 0.88450021]],
364+
[[-0.56164235, -0.70078993, -0.98865038, -0.66950929]],
365+
[[0.70746249, 0.24812828, 1.70954895, 0.88343531]],
351366
]
352367
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=3)
353368

@@ -362,7 +377,7 @@ def test_class_gradient_label_wrong_type(self):
362377

363378
def test_loss_gradient(self):
364379
grad_predicted = self.classifier.loss_gradient(self.x_test_iris[0:1], self.y_test_iris[0:1])
365-
grad_expected = np.asarray([[-0.21690657, -0.08809226, -0.51512082, -0.27002635]])
380+
grad_expected = np.asarray([[-0.21654, -0.08701016, -0.51516586, -0.26970267]])
366381
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
367382

368383
def test_save(self):
@@ -541,36 +556,36 @@ def test_class_gradient_none(self):
541556
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=None)
542557
grad_expected = [
543558
[
544-
[-0.34648966, 1.63777444, -3.51845999, -1.4609451],
545-
[-0.11198028, -2.51565392, 0.71538245, -0.44830889],
546-
[-0.38021886, -0.57562105, 3.59966607, 2.31772514],
559+
[-0.34659522, 1.6376213, -3.51851979, -1.46078468],
560+
[-0.1121541, -2.51552211, 0.71569165, -0.44883585],
561+
[-0.380205, -0.57552204, 3.59972012, 2.31760663],
547562
]
548563
]
549564
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
550565

551566
def test_class_gradient_int_1(self):
552567
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=1)
553-
grad_expected = [[[-0.11198028, -2.51565392, 0.71538245, -0.44830889]]]
568+
grad_expected = [[[-0.1121541, -2.51552211, 0.71569165, -0.44883585]]]
554569
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
555570

556571
def test_class_gradient_int_2(self):
557572
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:2], label=1)
558573
grad_expected = [
559-
[[-0.11198028, -2.51565392, 0.71538245, -0.44830889]],
560-
[[-0.11198028, -2.51565392, 0.71538245, -0.44830889]],
574+
[[-0.1121541, -2.51552211, 0.71569165, -0.44883585]],
575+
[[-0.1121541, -2.51552211, 0.71569165, -0.44883585]],
561576
]
562577
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
563578

564579
def test_class_gradient_list_1(self):
565580
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:1], label=[1])
566-
grad_expected = [[[-0.11198028, -2.51565392, 0.71538245, -0.44830889]]]
581+
grad_expected = [[[-0.1121541, -2.51552211, 0.71569165, -0.44883585]]]
567582
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
568583

569584
def test_class_gradient_list_2(self):
570585
grad_predicted = self.classifier.class_gradient(self.x_test_iris[0:2], label=[1, 2])
571586
grad_expected = [
572-
[[-0.11198028, -2.51565392, 0.71538245, -0.44830889]],
573-
[[-0.38021886, -0.57562105, 3.59966607, 2.31772514]],
587+
[[-0.1121541, -2.51552211, 0.71569165, -0.44883585]],
588+
[[-0.380205, -0.57552204, 3.59972012, 2.31760663]],
574589
]
575590
np.testing.assert_array_almost_equal(grad_predicted, grad_expected, decimal=4)
576591

0 commit comments

Comments
 (0)