def test_binarize():
    print("Testing binarize() functionality...")
    chatbot = Chatbot(False)
    if assertNumpyArrayEquals(
        chatbot.binarize(np.array([[1, 2.5, 5, 0]])),
        np.array([[-1., -1., 1., 0.]]),
        "Incorrect output for binarize(np.array([[1, 2.5, 5, 0]]))."
    ):
        print("1. binarize() sanity check passed!")

    if assertNumpyArrayEquals(
        chatbot.binarize(np.array([[0, 1], [2.5, 5]])),
        np.array([[0, -1], [-1, 1]]),
        "Incorrect output for binarize(np.array([[0, 1], [2.5, 5]]))."
    ):
        print("2. binarize() sanity check passed!")
    print()
Beispiel #2
0
def test_binarize():
    print("Testing binarize() functionality...")
    chatbot = Chatbot(False)
    if assert_numpy_array_equals(
            chatbot.binarize(np.array([[1, 2.5, 5, 0]])),
            np.array([[-1., -1., 1., 0.]]),
            "Incorrect output for binarize(np.array([[1, 2.5, 5, 0]]))."):
        print("binarize() sanity check passed!")
    print()