Skip to content

Commit 6b4bf07

Browse files
committed
TEST: Add another test
1 parent f8fe296 commit 6b4bf07

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

integration_tests/test_pkg_lnn.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,23 @@ def main0():
6767

6868
plot_graph(p, input_vectors, outputs)
6969

70+
def main1():
71+
p: Perceptron = Perceptron(0, [0.0], 0.0, 0, 0.0, 0.0, 0)
72+
init_perceptron(p, 2, 0.05, 10000, 90.0)
73+
print_perceptron(p)
74+
print("=================================")
75+
76+
input_vectors: list[list[f64]] = [[-1.0, -1.0], [-1.0, 1.0], [1.0, -1.0], [1.0, 1.0], [1.5, 1.0]]
77+
outputs: list[i32] = [1, 1, -1, 1, -1]
78+
79+
normalize_input_vectors(input_vectors)
80+
train_dataset(p, input_vectors, outputs)
81+
print_perceptron(p)
82+
83+
assert p.cur_accuracy > 50.0
84+
assert p.epochs_cnt > 1
85+
86+
plot_graph(p, input_vectors, outputs)
87+
7088
main0()
89+
main1()

0 commit comments

Comments
 (0)