예제 #1
0
 def test_to_dict(self):
     tail = NoTail()
     output_dict = tail.to_dict()
     assert "class" in output_dict
     assert output_dict["class"] == "NoTail"
     assert "params" in output_dict
     assert output_dict["params"] is None
예제 #2
0
 def test_compute_b(self):
     tail = NoTail()
     y = np.random.rand(10)
     b = tail.compute_b(y)
     assert b.shape == (10, 1)
     assert np.all(b == y.reshape((-1, 1)))
     b = tail.compute_b(y, 2)
     assert b.shape == (10, 1)
     assert np.all(b == y.reshape((-1, 1)))
예제 #3
0
 def test_evaluate(self):
     tail = NoTail()
     x = np.random.rand(10, 2)
     y = tail.evaluate(x)
     assert y.shape == (10, )
     assert np.all(y == np.zeros(10))
     x = np.random.rand(20, 2)
     y = tail.evaluate(x)
     assert y.shape == (20, )
     assert np.all(y == np.zeros(20))
예제 #4
0
 def test_compute_P(self):
     tail = NoTail()
     x = np.random.rand(10, 2)
     P = tail.compute_P(x)
     assert P is None
예제 #5
0
 def test_degree(self):
     tail = NoTail()
     assert tail.degree == -1
예제 #6
0
 def test_set_params(self):
     tail = NoTail()
     tail.set_params(1)
     assert True
예제 #7
0
 def test_params(self):
     tail = NoTail()
     assert tail.params is None
예제 #8
0
 def test___init__(self):
     tail = NoTail()
     assert True