@@ -300,38 +300,32 @@ def test_class_gradient_none_2(self):
300300
301301 def test_class_gradient_int_1 (self ):
302302 grad_predicted = self .classifier .class_gradient (self .x_test_iris [0 :1 ], label = 1 )
303- grad_expected = [[[- 0.56322294 , - 0.70493763 , - 0.98874801 , - 0.67053026 ]]]
303+ grad_expected = [[[- 0.56317311 , - 0.70493763 , - 0.98908609 , - 0.67106276 ]]]
304304
305305 for i_shape in range (4 ):
306- print (grad_predicted [0 , 0 , i_shape ])
307306 self .assertAlmostEqual (grad_predicted [0 , 0 , i_shape ], grad_expected [0 ][0 ][i_shape ], 3 )
308307
309308 def test_class_gradient_int_2 (self ):
310309 grad_predicted = self .classifier .class_gradient (self .x_test_iris [0 :2 ], label = 1 )
311310 grad_expected = [
312- [[- 0.56322294 , - 0.70427608 , - 0.98874801 , - 0.67053026 ]],
313- [[- 0.50528532 , - 0.71700042 , - 0.82467848 , - 0.59614766 ]],
311+ [[- 0.56317306 , - 0.70493776 , - 0.98908573 , - 0.67106259 ]],
312+ [[- 0.50522697 , - 0.71762568 , - 0.82497531 , - 0.5966416 ]],
314313 ]
315- print ("grad_predicted" )
316- print (grad_predicted )
317314 np .testing .assert_array_almost_equal (grad_predicted , grad_expected , decimal = 4 )
318315
319316 def test_class_gradient_list_1 (self ):
320317 grad_predicted = self .classifier .class_gradient (self .x_test_iris [0 :1 ], label = [1 ])
321- grad_expected = [[[- 0.56322294 , - 0.70427608 , - 0.98874801 , - 0.67053026 ]]]
318+ grad_expected = [[[- 0.56317311 , - 0.70493763 , - 0.98874801 , - 0.67053026 ]]]
322319
323320 for i_shape in range (4 ):
324- print (grad_predicted [0 , 0 , i_shape ])
325321 self .assertAlmostEqual (grad_predicted [0 , 0 , i_shape ], grad_expected [0 ][0 ][i_shape ], 3 )
326322
327323 def test_class_gradient_list_2 (self ):
328324 grad_predicted = self .classifier .class_gradient (self .x_test_iris [0 :2 ], label = [1 , 2 ])
329325 grad_expected = [
330- [[- 0.56322294 , - 0.70427608 , - 0.98874801 , - 0.67053026 ]],
331- [[0.70875132 , 0.25104877 , 1.70929277 , 0.88410652 ]],
326+ [[- 0.56317306 , - 0.70493776 , - 0.98908573 , - 0.67106259 ]],
327+ [[0.70866591 , 0.25158876 , 1.70947325 , 0.88450021 ]],
332328 ]
333- print ("grad_predicted" )
334- print (grad_predicted )
335329 np .testing .assert_array_almost_equal (grad_predicted , grad_expected , decimal = 4 )
336330
337331 def test_class_gradient_label_wrong_type (self ):
@@ -345,9 +339,7 @@ def test_class_gradient_label_wrong_type(self):
345339
346340 def test_loss_gradient (self ):
347341 grad_predicted = self .classifier .loss_gradient (self .x_test_iris [0 :1 ], self .y_test_iris [0 :1 ])
348- grad_expected = np .asarray ([[- 0.21693791 , - 0.08792436 , - 0.51507443 , - 0.26990796 ]])
349- print ("grad_predicted" )
350- print (grad_predicted )
342+ grad_expected = np .asarray ([[- 0.21690657 , - 0.08809226 , - 0.51512082 , - 0.27002635 ]])
351343 np .testing .assert_array_almost_equal (grad_predicted , grad_expected , decimal = 4 )
352344
353345 def test_save (self ):
0 commit comments