@@ -54,6 +54,12 @@ def fit_predict(self, x, **kwargs):
54
54
return self .cluster_labels_to_return
55
55
56
56
57
+ @pytest .mark .skip_framework (
58
+ "keras" ,
59
+ "kerastf" ,
60
+ "pytorch" ,
61
+ "non_dl_frameworks" ,
62
+ )
57
63
class CCAUDTestCaseBase (unittest .TestCase ):
58
64
59
65
def setUp (self ):
@@ -98,12 +104,6 @@ def setUp(self):
98
104
)
99
105
100
106
101
- @pytest .mark .skip_framework (
102
- "keras" ,
103
- "kerastf" ,
104
- "pytorch" ,
105
- "non_dl_frameworks" ,
106
- )
107
107
class TestInitialization (CCAUDTestCaseBase ):
108
108
"""
109
109
Unit tests for the ClusteringCentroidAnalysis class, focusing on
@@ -235,6 +235,7 @@ def test_init_invalid_layer_non_relu(self):
235
235
)
236
236
237
237
238
+ @pytest .mark .framework_agnostic
238
239
class TestEncodeLabels (unittest .TestCase ):
239
240
"""
240
241
Unit tests for the ClusteringCentroidAnalysis label encoding, needed for proper clustering.
@@ -260,12 +261,6 @@ def test_encode_multi_labels(self):
260
261
self .assertEqual ({"A" : 0 , "B" : 1 , "C" : 2 , "D" : 3 }, reverse_mapping )
261
262
262
263
263
- @pytest .mark .skip_framework (
264
- "keras" ,
265
- "kerastf" ,
266
- "pytorch" ,
267
- "non_dl_frameworks" ,
268
- )
269
264
class TestCalculateCentroid (CCAUDTestCaseBase ):
270
265
"""
271
266
Unit tests for the ClusteringCentroidAnalysis centroid calculations, needed for PCD.
@@ -591,12 +586,6 @@ def fit_predict(self, x, **kwargs):
591
586
self .assertEqual (len (cluster_class_mapping ), 0 )
592
587
593
588
594
- @pytest .mark .skip_framework (
595
- "keras" ,
596
- "kerastf" ,
597
- "pytorch" ,
598
- "non_dl_frameworkslearn" ,
599
- )
600
589
class TestFeatureExtraction (CCAUDTestCaseBase ):
601
590
"""Unit tests for the _feature_extraction function."""
602
591
@@ -1208,6 +1197,12 @@ def mock_misclass_rate(class_label, deviation):
1208
1197
self .assertLess (np .mean (self .y_train [np .where (is_clean_np == 1 )]), 0.2 )
1209
1198
1210
1199
1200
+ @pytest .mark .skip_framework (
1201
+ "keras" ,
1202
+ "kerastf" ,
1203
+ "pytorch" ,
1204
+ "non_dl_frameworks" ,
1205
+ )
1211
1206
class TestEvaluateDefence (unittest .TestCase ):
1212
1207
"""
1213
1208
Unit tests for the evaluate_defence method of the ClusteringCentroidAnalysis class.
0 commit comments