From 0e48edfbaf2457d9aa480f93bcda478f3bbbb9f2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 5 Feb 2023 01:10:15 +0100 Subject: [PATCH] Added the new MLPP implementation to the tests. --- test/mlpp_tests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/mlpp_tests.cpp b/test/mlpp_tests.cpp index 1528d46..a16d997 100644 --- a/test/mlpp_tests.cpp +++ b/test/mlpp_tests.cpp @@ -397,6 +397,21 @@ void MLPPTests::test_mlp(bool ui) { model.gradientDescent(0.1, 10000, ui); alg.printVector(model.modelSetTest(inputSet)); std::cout << "ACCURACY: " << 100 * model.score() << "%" << std::endl; + + Ref input_set; + input_set.instance(); + input_set->set_from_std_vectors(inputSet); + + Ref output_set; + output_set.instance(); + output_set->set_from_std_vector(outputSet); + + MLPPMLP model_new(input_set, output_set, 2); + model_new.gradient_descent(0.1, 10000, ui); + String res = model_new.model_set_test(input_set)->to_string(); + res += "\nACCURACY: " + String::num(100 * model_new.score()) + "%"; + + PLOG_MSG(res); } void MLPPTests::test_soft_max_network(bool ui) { MLPPLinAlg alg;