def test06_objective_soft_max_gradient_X_sanity_test(self): C, W, X = create_C_W_X() try: objective_soft_max_gradient_X(X, W, C) self.assertTrue(True) except: self.assertTrue(False)
def test08_objective_soft_max_gradient_W_dimension_compare_with_naive(self): C, W, X = create_C_W_X() c1 = np.round(objective_soft_max_gradient_W_old_but_gold(X, W, C), 10) c2 = np.round(objective_soft_max_gradient_W(X, W, C), 10) self.assertTrue(array_equal(c1, c2))
def test07_objective_soft_max_gradient_X_dimension(self): C, W, X = create_C_W_X() exptected_shape = array([W.shape[0], X.shape[1]]) result_shape = objective_soft_max_gradient_X(X, W, C).shape self.assertTrue(array_equal(exptected_shape, result_shape))
def test00_init_test(self): C, W, X = create_C_W_X() self.assertEqual(X.T.shape[1], W.shape[0]) # XT@W self.assertEqual(C.shape[1], X.shape[1]) self.assertEqual(C.shape[0], W.shape[1])