1 //   OpenNN: Open Neural Networks Library
2 //   www.opennn.net
3 //
4 //   I N P U T   S E L E C T I O N   T E S T   C L A S S
5 //
6 //   Artificial Intelligence Techniques SL
7 //   artelnics@artelnics.com
8 
9 #include "inputs_selection_test.h"
10 
11 
InputsSelectionTest()12 InputsSelectionTest::InputsSelectionTest() : UnitTesting()
13 {
14 }
15 
16 
~InputsSelectionTest()17 InputsSelectionTest::~InputsSelectionTest()
18 {
19 }
20 
21 
test_constructor()22 void InputsSelectionTest::test_constructor() // @todo
23 {
24     cout << "test_constructor\n";
25 
26     NeuralNetwork nn;
27     DataSet ds;
28 
29     TrainingStrategy training_strategy(&nn, &ds);
30 
31     GrowingInputs gi1(&training_strategy);
32 
33     assert_true(gi1.has_training_strategy() == true, LOG);
34 
35     GrowingInputs gi2;
36 
37     assert_true(gi2.has_training_strategy() == false, LOG);
38 
39 }
40 
test_destructor()41 void InputsSelectionTest::test_destructor() // @todo
42 {
43     cout << "tes_destructor\n";
44 
45     GrowingInputs* gi = new GrowingInputs;
46 
47     delete gi;
48 }
49 
50 
test_get_training_strategy_pointer()51 void InputsSelectionTest::test_get_training_strategy_pointer() // @todo
52 {
53     cout << "test_get_training_strategy_pointer\n";
54 
55     NeuralNetwork nn;
56     DataSet ds;
57 
58     TrainingStrategy training_strategy(&nn,&ds);
59 
60     GrowingInputs gi(&training_strategy);
61 
62     assert_true(gi.get_training_strategy_pointer() != nullptr, LOG);
63 }
64 
65 
test_set_training_strategy_pointer()66 void InputsSelectionTest::test_set_training_strategy_pointer() // @todo
67 {
68     cout << "test_set_training_strategy_pointer\n";
69 
70     NeuralNetwork nn;
71     DataSet ds;
72 
73     TrainingStrategy training_strategy(&nn, &ds);
74 
75     GrowingInputs growing_inputs;
76 
77     growing_inputs.set_training_strategy_pointer(&training_strategy);
78 
79     assert_true(growing_inputs.get_training_strategy_pointer() != nullptr, LOG);
80 }
81 
test_set_default()82 void InputsSelectionTest::test_set_default() // @todo
83 {
84     cout << "test_set_default\n";
85 
86 }
87 
test_set_loss_calculation_method()88 void InputsSelectionTest::test_set_loss_calculation_method() // @todo
89 {
90     cout << "test_set_loss_calculation_method\n";
91 
92 }
93 
94 
test_get_final_loss()95 void InputsSelectionTest::test_get_final_loss() // @todo
96 {
97     cout << "test_get_final_loss\n";
98 
99 }
100 
test_calculate_losses()101 void InputsSelectionTest::test_calculate_losses() // @todo
102 {
103     cout << "test_calculate_losses\n";
104 
105 }
106 
test_get_parameters_order()107 void InputsSelectionTest::test_get_parameters_order() // @todo
108 {
109     cout << "test_get_parameters_order\n";
110 
111 }
112 
113 
114 // Unit testing methods
115 
run_test_case()116 void InputsSelectionTest::run_test_case() // @todo
117 {
118     cout << "Running inputs selection algorithm test case...\n";
119 
120 
121     // Constructor and destructor methods
122 
123     test_constructor();
124     test_destructor();
125 
126     // Get methods
127 
128     test_get_training_strategy_pointer();
129 
130     // Set methods
131 
132     test_set_training_strategy_pointer();
133     test_set_default();
134     test_get_final_loss();
135     test_calculate_losses();
136     test_get_parameters_order();
137 
138     cout << "End of inputs selection algorithm test case.\n\n";
139 }
140 
141