16 #include "performance_functional.h"
28 : neural_network_pointer(NULL)
29 , data_set_pointer(NULL)
30 , mathematical_model_pointer(NULL)
31 , sum_squared_error_objective_pointer(NULL)
32 , mean_squared_error_objective_pointer(NULL)
33 , root_mean_squared_error_objective_pointer(NULL)
34 , normalized_squared_error_objective_pointer(NULL)
35 , Minkowski_error_objective_pointer(NULL)
36 , cross_entropy_error_objective_pointer(NULL)
37 , outputs_integrals_objective_pointer(NULL)
38 , solutions_error_objective_pointer(NULL)
39 , final_solutions_error_objective_pointer(NULL)
40 , independent_parameters_error_objective_pointer(NULL)
41 , inverse_sum_squared_error_objective_pointer(NULL)
42 , user_objective_pointer(NULL)
43 , neural_parameters_norm_regularization_pointer(NULL)
44 , outputs_integrals_regularization_pointer(NULL)
45 , user_regularization_pointer(NULL)
46 , outputs_integrals_constraints_pointer(NULL)
47 , solutions_error_constraints_pointer(NULL)
48 , final_solutions_error_constraints_pointer(NULL)
49 , independent_parameters_error_constraints_pointer(NULL)
50 , user_constraints_pointer(NULL)
69 : neural_network_pointer(new_neural_network_pointer)
70 , data_set_pointer(NULL)
71 , mathematical_model_pointer(NULL)
72 , sum_squared_error_objective_pointer(NULL)
73 , mean_squared_error_objective_pointer(NULL)
74 , root_mean_squared_error_objective_pointer(NULL)
75 , normalized_squared_error_objective_pointer(NULL)
76 , Minkowski_error_objective_pointer(NULL)
77 , cross_entropy_error_objective_pointer(NULL)
78 , outputs_integrals_objective_pointer(NULL)
79 , solutions_error_objective_pointer(NULL)
80 , final_solutions_error_objective_pointer(NULL)
81 , independent_parameters_error_objective_pointer(NULL)
82 , inverse_sum_squared_error_objective_pointer(NULL)
83 , user_objective_pointer(NULL)
84 , neural_parameters_norm_regularization_pointer(NULL)
85 , outputs_integrals_regularization_pointer(NULL)
86 , user_regularization_pointer(NULL)
87 , outputs_integrals_constraints_pointer(NULL)
88 , solutions_error_constraints_pointer(NULL)
89 , final_solutions_error_constraints_pointer(NULL)
90 , independent_parameters_error_constraints_pointer(NULL)
91 , user_constraints_pointer(NULL)
111 : neural_network_pointer(new_neural_network_pointer)
112 , data_set_pointer(new_data_set_pointer)
113 , mathematical_model_pointer(NULL)
114 , sum_squared_error_objective_pointer(NULL)
115 , mean_squared_error_objective_pointer(NULL)
116 , root_mean_squared_error_objective_pointer(NULL)
117 , normalized_squared_error_objective_pointer(NULL)
118 , Minkowski_error_objective_pointer(NULL)
119 , cross_entropy_error_objective_pointer(NULL)
120 , outputs_integrals_objective_pointer(NULL)
121 , solutions_error_objective_pointer(NULL)
122 , final_solutions_error_objective_pointer(NULL)
123 , independent_parameters_error_objective_pointer(NULL)
124 , inverse_sum_squared_error_objective_pointer(NULL)
125 , user_objective_pointer(NULL)
126 , neural_parameters_norm_regularization_pointer(NULL)
127 , outputs_integrals_regularization_pointer(NULL)
128 , user_regularization_pointer(NULL)
129 , outputs_integrals_constraints_pointer(NULL)
130 , solutions_error_constraints_pointer(NULL)
131 , final_solutions_error_constraints_pointer(NULL)
132 , independent_parameters_error_constraints_pointer(NULL)
133 , user_constraints_pointer(NULL)
154 : neural_network_pointer(new_neural_network_pointer)
155 , data_set_pointer(NULL)
156 , mathematical_model_pointer(new_mathematical_model_pointer)
157 , sum_squared_error_objective_pointer(NULL)
158 , mean_squared_error_objective_pointer(NULL)
159 , root_mean_squared_error_objective_pointer(NULL)
160 , normalized_squared_error_objective_pointer(NULL)
161 , Minkowski_error_objective_pointer(NULL)
162 , cross_entropy_error_objective_pointer(NULL)
163 , outputs_integrals_objective_pointer(NULL)
164 , solutions_error_objective_pointer(NULL)
165 , final_solutions_error_objective_pointer(NULL)
166 , independent_parameters_error_objective_pointer(NULL)
167 , inverse_sum_squared_error_objective_pointer(NULL)
168 , user_objective_pointer(NULL)
169 , neural_parameters_norm_regularization_pointer(NULL)
170 , outputs_integrals_regularization_pointer(NULL)
171 , user_regularization_pointer(NULL)
172 , outputs_integrals_constraints_pointer(NULL)
173 , solutions_error_constraints_pointer(NULL)
174 , final_solutions_error_constraints_pointer(NULL)
175 , independent_parameters_error_constraints_pointer(NULL)
176 , user_constraints_pointer(NULL)
197 : neural_network_pointer(new_neural_network_pointer)
198 , data_set_pointer(new_data_set_pointer)
199 , mathematical_model_pointer(new_mathematical_model_pointer)
200 , sum_squared_error_objective_pointer(NULL)
201 , mean_squared_error_objective_pointer(NULL)
202 , root_mean_squared_error_objective_pointer(NULL)
203 , normalized_squared_error_objective_pointer(NULL)
204 , Minkowski_error_objective_pointer(NULL)
205 , cross_entropy_error_objective_pointer(NULL)
206 , outputs_integrals_objective_pointer(NULL)
207 , solutions_error_objective_pointer(NULL)
208 , final_solutions_error_objective_pointer(NULL)
209 , independent_parameters_error_objective_pointer(NULL)
210 , inverse_sum_squared_error_objective_pointer(NULL)
211 , user_objective_pointer(NULL)
212 , neural_parameters_norm_regularization_pointer(NULL)
213 , outputs_integrals_regularization_pointer(NULL)
214 , user_regularization_pointer(NULL)
215 , outputs_integrals_constraints_pointer(NULL)
216 , solutions_error_constraints_pointer(NULL)
217 , final_solutions_error_constraints_pointer(NULL)
218 , independent_parameters_error_constraints_pointer(NULL)
219 , user_constraints_pointer(NULL)
237 : neural_network_pointer(NULL)
238 , data_set_pointer(NULL)
239 , mathematical_model_pointer(NULL)
240 , sum_squared_error_objective_pointer(NULL)
241 , mean_squared_error_objective_pointer(NULL)
242 , root_mean_squared_error_objective_pointer(NULL)
243 , normalized_squared_error_objective_pointer(NULL)
244 , Minkowski_error_objective_pointer(NULL)
245 , cross_entropy_error_objective_pointer(NULL)
246 , outputs_integrals_objective_pointer(NULL)
247 , solutions_error_objective_pointer(NULL)
248 , final_solutions_error_objective_pointer(NULL)
249 , independent_parameters_error_objective_pointer(NULL)
250 , inverse_sum_squared_error_objective_pointer(NULL)
251 , user_objective_pointer(new_user_objective_pointer)
252 , neural_parameters_norm_regularization_pointer(NULL)
253 , outputs_integrals_regularization_pointer(NULL)
254 , user_regularization_pointer(NULL)
255 , outputs_integrals_constraints_pointer(NULL)
256 , solutions_error_constraints_pointer(NULL)
257 , final_solutions_error_constraints_pointer(NULL)
258 , independent_parameters_error_constraints_pointer(NULL)
259 , user_constraints_pointer(NULL)
277 : neural_network_pointer(NULL)
278 , data_set_pointer(NULL)
279 , mathematical_model_pointer(NULL)
280 , sum_squared_error_objective_pointer(NULL)
281 , mean_squared_error_objective_pointer(NULL)
282 , root_mean_squared_error_objective_pointer(NULL)
283 , normalized_squared_error_objective_pointer(NULL)
284 , Minkowski_error_objective_pointer(NULL)
285 , cross_entropy_error_objective_pointer(NULL)
286 , outputs_integrals_objective_pointer(NULL)
287 , solutions_error_objective_pointer(NULL)
288 , final_solutions_error_objective_pointer(NULL)
289 , independent_parameters_error_objective_pointer(NULL)
290 , inverse_sum_squared_error_objective_pointer(NULL)
291 , user_objective_pointer(NULL)
292 , neural_parameters_norm_regularization_pointer(NULL)
293 , outputs_integrals_regularization_pointer(NULL)
294 , user_regularization_pointer(NULL)
295 , outputs_integrals_constraints_pointer(NULL)
296 , solutions_error_constraints_pointer(NULL)
297 , final_solutions_error_constraints_pointer(NULL)
298 , independent_parameters_error_constraints_pointer(NULL)
299 , user_constraints_pointer(NULL)
318 : neural_network_pointer(NULL)
319 , data_set_pointer(NULL)
320 , mathematical_model_pointer(NULL)
321 , sum_squared_error_objective_pointer(NULL)
322 , mean_squared_error_objective_pointer(NULL)
323 , root_mean_squared_error_objective_pointer(NULL)
324 , normalized_squared_error_objective_pointer(NULL)
325 , Minkowski_error_objective_pointer(NULL)
326 , cross_entropy_error_objective_pointer(NULL)
327 , outputs_integrals_objective_pointer(NULL)
328 , solutions_error_objective_pointer(NULL)
329 , final_solutions_error_objective_pointer(NULL)
330 , independent_parameters_error_objective_pointer(NULL)
331 , inverse_sum_squared_error_objective_pointer(NULL)
332 , user_objective_pointer(NULL)
333 , neural_parameters_norm_regularization_pointer(NULL)
334 , outputs_integrals_regularization_pointer(NULL)
335 , user_regularization_pointer(NULL)
336 , outputs_integrals_constraints_pointer(NULL)
337 , solutions_error_constraints_pointer(NULL)
338 , final_solutions_error_constraints_pointer(NULL)
339 , independent_parameters_error_constraints_pointer(NULL)
340 , user_constraints_pointer(NULL)
348 from_XML(performance_functional_document);
360 : neural_network_pointer(NULL)
361 , data_set_pointer(NULL)
362 , mathematical_model_pointer(NULL)
363 , sum_squared_error_objective_pointer(NULL)
364 , mean_squared_error_objective_pointer(NULL)
365 , root_mean_squared_error_objective_pointer(NULL)
366 , normalized_squared_error_objective_pointer(NULL)
367 , Minkowski_error_objective_pointer(NULL)
368 , cross_entropy_error_objective_pointer(NULL)
369 , outputs_integrals_objective_pointer(NULL)
370 , solutions_error_objective_pointer(NULL)
371 , final_solutions_error_objective_pointer(NULL)
372 , independent_parameters_error_objective_pointer(NULL)
373 , inverse_sum_squared_error_objective_pointer(NULL)
374 , user_objective_pointer(NULL)
375 , neural_parameters_norm_regularization_pointer(NULL)
376 , outputs_integrals_regularization_pointer(NULL)
377 , user_regularization_pointer(NULL)
378 , outputs_integrals_constraints_pointer(NULL)
379 , solutions_error_constraints_pointer(NULL)
380 , final_solutions_error_constraints_pointer(NULL)
381 , independent_parameters_error_constraints_pointer(NULL)
382 , user_constraints_pointer(NULL)
402 case SUM_SQUARED_ERROR_OBJECTIVE:
408 case MEAN_SQUARED_ERROR_OBJECTIVE:
414 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
420 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
426 case MINKOWSKI_ERROR_OBJECTIVE:
432 case CROSS_ENTROPY_ERROR_OBJECTIVE:
438 case OUTPUTS_INTEGRALS_OBJECTIVE:
444 case SOLUTIONS_ERROR_OBJECTIVE:
450 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
456 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
462 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
476 std::ostringstream buffer;
478 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
479 <<
"Copy constructor.\n"
480 <<
"Unknown objective type.\n";
482 throw std::logic_error(buffer.str());
491 case NO_REGULARIZATION:
497 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
503 case OUTPUTS_INTEGRALS_REGULARIZATION:
509 case USER_REGULARIZATION:
517 std::ostringstream buffer;
519 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
520 <<
"Copy constructor.\n"
521 <<
"Unknown regularization type.\n";
523 throw std::logic_error(buffer.str());
538 case OUTPUTS_INTEGRALS_CONSTRAINTS:
544 case SOLUTIONS_ERROR_CONSTRAINTS:
550 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
556 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
562 case USER_CONSTRAINTS:
570 std::ostringstream buffer;
572 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
573 <<
"Copy constructor.\n"
574 <<
"Unknown constraints type.\n";
576 throw std::logic_error(buffer.str());
695 if(generalization_instances_number == 0)
750 std::ostringstream buffer;
752 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
753 <<
"void check_neural_network(void) const.\n"
754 <<
"Pointer to neural network is NULL.\n";
756 throw std::logic_error(buffer.str());
772 std::ostringstream buffer;
774 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
775 <<
"void check_performance_terms(void) const method.\n"
776 <<
"None objective, regularization or constraints terms are used.\n";
778 throw std::logic_error(buffer.str());
797 std::ostringstream buffer;
799 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
800 <<
"SumSquaredError* get_sum_squared_error_objective_pointer(void) const method.\n"
801 <<
"Pointer to sum squared error objective is NULL.\n";
803 throw std::logic_error(buffer.str());
825 std::ostringstream buffer;
827 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
828 <<
"MeanSquaredError* get_mean_squared_error_objective_pointer(void) const method.\n"
829 <<
"Pointer to mean squared error objective is NULL.\n";
831 throw std::logic_error(buffer.str());
853 std::ostringstream buffer;
855 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
856 <<
"RootMeanSquaredError* get_root_mean_squared_error_objective_pointer(void) const method.\n"
857 <<
"Pointer to root mean squared error objective is NULL.\n";
859 throw std::logic_error(buffer.str());
881 std::ostringstream buffer;
883 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
884 <<
"NormalizedSquaredError* get_normalized_squared_error_objective_pointer(void) const method.\n"
885 <<
"Pointer to normalized squared error objective is NULL.\n";
887 throw std::logic_error(buffer.str());
909 std::ostringstream buffer;
911 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
912 <<
"MinkowskiError* get_Minkowski_error_objective_pointer(void) const method.\n"
913 <<
"Pointer to Minkowski error objective is NULL.\n";
915 throw std::logic_error(buffer.str());
937 std::ostringstream buffer;
939 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
940 <<
"SumSquaredError* get_cross_entropy_error_objective_pointer(void) const method.\n"
941 <<
"Pointer to cross entropy error objective is NULL.\n";
943 throw std::logic_error(buffer.str());
966 std::ostringstream buffer;
968 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
969 <<
"OutputsIntegrals* get_outputs_integrals_objective_pointer(void) const method.\n"
970 <<
"Pointer to outputs integrals objective is NULL.\n";
972 throw std::logic_error(buffer.str());
994 std::ostringstream buffer;
996 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
997 <<
"SolutionsError* get_solutions_error_objective_pointer(void) const method.\n"
998 <<
"Pointer to solutions error objective is NULL.\n";
1000 throw std::logic_error(buffer.str());
1022 std::ostringstream buffer;
1024 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1025 <<
"FinalSolutionsError* get_final_solutions_error_objective_pointer(void) const method.\n"
1026 <<
"Pointer to final solutions error objective is NULL.\n";
1028 throw std::logic_error(buffer.str());
1050 std::ostringstream buffer;
1052 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1053 <<
"IndependentParametersError* get_independent_parameters_error_objective_pointer(void) const method.\n"
1054 <<
"Pointer to independent parameters error objective is NULL.\n";
1056 throw std::logic_error(buffer.str());
1078 std::ostringstream buffer;
1080 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1081 <<
"InverseSumSquaredError* get_inverse_sum_squared_error_objective_pointer(void) const method.\n"
1082 <<
"Pointer to inverse sum squared error objective is NULL.\n";
1084 throw std::logic_error(buffer.str());
1106 std::ostringstream buffer;
1108 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1109 <<
"PerformanceTerm* get_user_objective_pointer(void) const method.\n"
1110 <<
"Pointer to user objective is NULL.\n";
1112 throw std::logic_error(buffer.str());
1134 std::ostringstream buffer;
1136 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1137 <<
"NeuralParametersNorm* get_neural_parameters_norm_regularization_pointer(void) const method.\n"
1138 <<
"Pointer to neural parameters norm regularization is NULL.\n";
1140 throw std::logic_error(buffer.str());
1162 std::ostringstream buffer;
1164 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1165 <<
"NeuralParametersNorm* get_outputs_integrals_regularization_pointer(void) const method.\n"
1166 <<
"Pointer to outputs integrals regularization is NULL.\n";
1168 throw std::logic_error(buffer.str());
1190 std::ostringstream buffer;
1192 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1193 <<
"PerformanceTerm* get_user_regularization_pointer(void) const method.\n"
1194 <<
"Pointer to user regularization is NULL.\n";
1196 throw std::logic_error(buffer.str());
1218 std::ostringstream buffer;
1220 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1221 <<
"OutputsIntegrals* get_outputs_integrals_constraints_pointer(void) const method.\n"
1222 <<
"Pointer to outputs integrals constraints is NULL.\n";
1224 throw std::logic_error(buffer.str());
1246 std::ostringstream buffer;
1248 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1249 <<
"SolutionsError* get_outputs_integrals_constraints_pointer(void) const method.\n"
1250 <<
"Pointer to solutions error constraints is NULL.\n";
1252 throw std::logic_error(buffer.str());
1274 std::ostringstream buffer;
1276 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1277 <<
"FinalSolutionsError* get_final_solutions_error_constraints_pointer(void) const method.\n"
1278 <<
"Pointer to final solutions error constraints is NULL.\n";
1280 throw std::logic_error(buffer.str());
1302 std::ostringstream buffer;
1304 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1305 <<
"IndependentParametersError* get_independent_parameters_error_constraints_pointer(void) const method.\n"
1306 <<
"Pointer to solutions error constraints is NULL.\n";
1308 throw std::logic_error(buffer.str());
1330 std::ostringstream buffer;
1332 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1333 <<
"PerformanceTerm* get_user_constraints_pointer(void) const method.\n"
1334 <<
"Pointer to user constraints is NULL.\n";
1336 throw std::logic_error(buffer.str());
1383 return(
"NO_OBJECTIVE");
1387 return(
"SUM_SQUARED_ERROR_OBJECTIVE");
1391 return(
"MEAN_SQUARED_ERROR_OBJECTIVE");
1395 return(
"ROOT_MEAN_SQUARED_ERROR_OBJECTIVE");
1399 return(
"NORMALIZED_SQUARED_ERROR_OBJECTIVE");
1403 return(
"MINKOWSKI_ERROR_OBJECTIVE");
1407 return(
"CROSS_ENTROPY_ERROR_OBJECTIVE");
1411 return(
"OUTPUTS_INTEGRALS_OBJECTIVE");
1415 return(
"SOLUTIONS_ERROR_OBJECTIVE");
1419 return(
"FINAL_SOLUTIONS_ERROR_OBJECTIVE");
1421 else if(
objective_type == INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE)
1423 return(
"INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE");
1427 return(
"INVERSE_SUM_SQUARED_ERROR_OBJECTIVE");
1431 return(
"USER_OBJECTIVE");
1435 std::ostringstream buffer;
1437 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1438 <<
"std::string write_objective_type(void) const method.\n"
1439 <<
"Unknown objective type.\n";
1441 throw std::logic_error(buffer.str());
1454 return(
"NO_REGULARIZATION");
1458 return(
"NEURAL_PARAMETERS_NORM_REGULARIZATION");
1462 return(
"OUTPUTS_INTEGRALS_REGULARIZATION");
1466 return(
"USER_REGULARIZATION_REGULARIZATION");
1470 std::ostringstream buffer;
1472 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1473 <<
"std::string write_regularization_type(void) const method.\n"
1474 <<
"Unknown regularization type.\n";
1476 throw std::logic_error(buffer.str());
1489 return(
"NO_CONSTRAINTS");
1493 return(
"OUTPUTS_INTEGRALS_CONSTRAINTS");
1497 return(
"SOLUTIONS_ERROR_CONSTRAINTS");
1501 return(
"FINAL_SOLUTIONS_ERROR_CONSTRAINTS");
1505 return(
"INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS");
1509 return(
"USER_CONSTRAINTS");
1513 std::ostringstream buffer;
1515 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1516 <<
"std::string write_constraints_type(void) const method.\n"
1517 <<
"Unknown constraints type.\n";
1519 throw std::logic_error(buffer.str());
1532 return(
"no objective");
1536 return(
"sum squared error");
1540 return(
"mean squared error");
1544 return(
"root mean squared error");
1548 return(
"normalized squared error");
1552 return(
"Minkowski error");
1556 return(
"cross entropy error");
1560 return(
"outputs integrals");
1564 return(
"solutions error");
1568 return(
"final solutions error");
1570 else if(
objective_type == INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE)
1572 return(
"independent parameters error");
1576 return(
"inverse sum squared error");
1580 return(
"user objective");
1584 std::ostringstream buffer;
1586 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1587 <<
"std::string write_objective_type_text(void) const method.\n"
1588 <<
"Unknown objective type.\n";
1590 throw std::logic_error(buffer.str());
1603 return(
"no regularization");
1607 return(
"neural parameters norm");
1611 return(
"outputs integrals");
1615 return(
"user regularization");
1619 std::ostringstream buffer;
1621 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1622 <<
"std::string write_regularization_type_text(void) const method.\n"
1623 <<
"Unknown regularization type.\n";
1625 throw std::logic_error(buffer.str());
1638 return(
"no constraints");
1642 return(
"outputs integrals");
1646 return(
"solutions error");
1650 return(
"fina solutions error");
1654 return(
"independent parameters error");
1658 return(
"user constraints");
1662 std::ostringstream buffer;
1664 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1665 <<
"std::string write_constraints_type_text(void) const method.\n"
1666 <<
"Unknown constraints type.\n";
1668 throw std::logic_error(buffer.str());
1703 case SUM_SQUARED_ERROR_OBJECTIVE:
1709 case MEAN_SQUARED_ERROR_OBJECTIVE:
1715 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
1721 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
1727 case MINKOWSKI_ERROR_OBJECTIVE:
1733 case CROSS_ENTROPY_ERROR_OBJECTIVE:
1739 case OUTPUTS_INTEGRALS_OBJECTIVE:
1745 case SOLUTIONS_ERROR_OBJECTIVE:
1751 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
1757 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
1763 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
1769 case USER_OBJECTIVE:
1777 std::ostringstream buffer;
1779 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1780 <<
"void set_neural_network_pointer(NeuralNetwork*) method.\n"
1781 <<
"Unknown objective type.\n";
1783 throw std::logic_error(buffer.str());
1792 case NO_REGULARIZATION:
1798 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
1804 case OUTPUTS_INTEGRALS_REGULARIZATION:
1810 case USER_REGULARIZATION:
1818 std::ostringstream buffer;
1820 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1821 <<
"void set_neural_network_pointer(NeuralNetwork*) method.\n"
1822 <<
"Unknown regularization type.\n";
1824 throw std::logic_error(buffer.str());
1833 case NO_CONSTRAINTS:
1839 case OUTPUTS_INTEGRALS_CONSTRAINTS:
1845 case SOLUTIONS_ERROR_CONSTRAINTS:
1851 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
1857 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
1863 case USER_CONSTRAINTS:
1871 std::ostringstream buffer;
1873 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1874 <<
"void set_neural_network_pointer(NeuralNetwork*) method.\n"
1875 <<
"Unknown constraints type.\n";
1877 throw std::logic_error(buffer.str());
1903 case SUM_SQUARED_ERROR_OBJECTIVE:
1909 case MEAN_SQUARED_ERROR_OBJECTIVE:
1915 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
1921 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
1927 case MINKOWSKI_ERROR_OBJECTIVE:
1933 case CROSS_ENTROPY_ERROR_OBJECTIVE:
1939 case OUTPUTS_INTEGRALS_OBJECTIVE:
1945 case SOLUTIONS_ERROR_OBJECTIVE:
1951 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
1957 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
1963 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
1969 case USER_OBJECTIVE:
1977 std::ostringstream buffer;
1979 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
1980 <<
"void set_mathematical_model_pointer(MathematicalModel*) method.\n"
1981 <<
"Unknown objective type.\n";
1983 throw std::logic_error(buffer.str());
1992 case NO_REGULARIZATION:
1998 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
2004 case OUTPUTS_INTEGRALS_REGULARIZATION:
2010 case USER_REGULARIZATION:
2018 std::ostringstream buffer;
2020 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2021 <<
"void set_mathematical_model_pointer(NeuralNetwork*) method.\n"
2022 <<
"Unknown regularization type.\n";
2024 throw std::logic_error(buffer.str());
2033 case NO_CONSTRAINTS:
2039 case OUTPUTS_INTEGRALS_CONSTRAINTS:
2045 case SOLUTIONS_ERROR_CONSTRAINTS:
2051 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
2057 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
2063 case USER_CONSTRAINTS:
2071 std::ostringstream buffer;
2073 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2074 <<
"void set_mathematical_model_pointer(NeuralNetwork*) method.\n"
2075 <<
"Unknown constraints type.\n";
2077 throw std::logic_error(buffer.str());
2103 case SUM_SQUARED_ERROR_OBJECTIVE:
2109 case MEAN_SQUARED_ERROR_OBJECTIVE:
2115 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
2121 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
2127 case MINKOWSKI_ERROR_OBJECTIVE:
2133 case CROSS_ENTROPY_ERROR_OBJECTIVE:
2139 case OUTPUTS_INTEGRALS_OBJECTIVE:
2145 case SOLUTIONS_ERROR_OBJECTIVE:
2151 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
2157 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
2163 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
2169 case USER_OBJECTIVE:
2177 std::ostringstream buffer;
2179 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2180 <<
"void set_data_set_pointer(DataSet*) method.\n"
2181 <<
"Unknown objective type.\n";
2183 throw std::logic_error(buffer.str());
2192 case NO_REGULARIZATION:
2198 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
2204 case OUTPUTS_INTEGRALS_REGULARIZATION:
2210 case USER_REGULARIZATION:
2218 std::ostringstream buffer;
2220 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2221 <<
"void set_data_set_pointer(DataSet*) method.\n"
2222 <<
"Unknown regularization type.\n";
2224 throw std::logic_error(buffer.str());
2233 case NO_CONSTRAINTS:
2239 case OUTPUTS_INTEGRALS_CONSTRAINTS:
2245 case SOLUTIONS_ERROR_CONSTRAINTS:
2251 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
2257 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
2263 case USER_CONSTRAINTS:
2271 std::ostringstream buffer;
2273 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2274 <<
"void set_data_set_pointer(DataSet*) method.\n"
2275 <<
"Unknown constraints type.\n";
2277 throw std::logic_error(buffer.str());
2346 if(new_objective_type ==
"NO_OBJECTIVE")
2350 else if(new_objective_type ==
"SUM_SQUARED_ERROR_OBJECTIVE")
2354 else if(new_objective_type ==
"MEAN_SQUARED_ERROR_OBJECTIVE")
2358 else if(new_objective_type ==
"ROOT_MEAN_SQUARED_ERROR_OBJECTIVE")
2362 else if(new_objective_type ==
"NORMALIZED_SQUARED_ERROR_OBJECTIVE")
2366 else if(new_objective_type ==
"MINKOWSKI_ERROR_OBJECTIVE")
2370 else if(new_objective_type ==
"OUTPUTS_INTEGRALS_OBJECTIVE")
2374 else if(new_objective_type ==
"SOLUTIONS_ERROR_OBJECTIVE")
2378 else if(new_objective_type ==
"FINAL_SOLUTIONS_ERROR_OBJECTIVE")
2382 else if(new_objective_type ==
"INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE")
2386 else if(new_objective_type ==
"INVERSE_SUM_SQUARED_ERROR_OBJECTIVE")
2390 else if(new_objective_type ==
"USER_OBJECTIVE")
2396 std::ostringstream buffer;
2398 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2399 <<
"void set_objective_type(const std::string&) method.\n"
2400 <<
"Unknown objective type: " << new_objective_type <<
".\n";
2402 throw std::logic_error(buffer.str());
2414 if(new_regularization_type ==
"NO_REGULARIZATION")
2418 else if(new_regularization_type ==
"NEURAL_PARAMETERS_NORM_REGULARIZATION")
2422 else if(new_regularization_type ==
"OUTPUTS_INTEGRALS_REGULARIZATION")
2428 std::ostringstream buffer;
2430 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2431 <<
"void set_regularization_type(const std::string&) method.\n"
2432 <<
"Unknown regularization type: " << new_regularization_type <<
".\n";
2434 throw std::logic_error(buffer.str());
2446 if(new_constraints_type ==
"NO_CONSTRAINTS")
2450 else if(new_constraints_type ==
"OUTPUTS_INTEGRALS_CONSTRAINTS")
2454 else if(new_constraints_type ==
"SOLUTIONS_ERROR_CONSTRAINTS")
2458 else if(new_constraints_type ==
"FINAL_SOLUTIONS_ERROR_CONSTRAINTS")
2462 else if(new_constraints_type ==
"INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS")
2466 else if(new_constraints_type ==
"USER_CONSTRAINTS")
2472 std::ostringstream buffer;
2474 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2475 <<
"void set_constraints_type(const std::string&) method.\n"
2476 <<
"Unknown constraints term type: " << new_constraints_type <<
".\n";
2478 throw std::logic_error(buffer.str());
2507 switch(new_objective_type)
2515 case SUM_SQUARED_ERROR_OBJECTIVE:
2521 case MEAN_SQUARED_ERROR_OBJECTIVE:
2527 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
2533 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
2539 case MINKOWSKI_ERROR_OBJECTIVE:
2545 case CROSS_ENTROPY_ERROR_OBJECTIVE:
2551 case OUTPUTS_INTEGRALS_OBJECTIVE:
2557 case SOLUTIONS_ERROR_OBJECTIVE:
2563 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
2569 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
2575 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
2581 case USER_OBJECTIVE:
2589 std::ostringstream buffer;
2591 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2592 <<
"void set_objective_type(const ObjectiveType&) method.\n"
2593 <<
"Unknown objective type.\n";
2595 throw std::logic_error(buffer.str());
2615 case NO_REGULARIZATION:
2621 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
2627 case OUTPUTS_INTEGRALS_REGULARIZATION:
2633 case USER_REGULARIZATION:
2641 std::ostringstream buffer;
2643 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2644 <<
"void set_regularization_type(const RegularizationType&) method.\n"
2645 <<
"Unknown regularization type.\n";
2647 throw std::logic_error(buffer.str());
2667 case NO_CONSTRAINTS:
2673 case OUTPUTS_INTEGRALS_CONSTRAINTS:
2679 case SOLUTIONS_ERROR_CONSTRAINTS:
2685 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
2691 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
2697 case USER_CONSTRAINTS:
2705 std::ostringstream buffer;
2707 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2708 <<
"void set_constraints_type(const ConstraintsType&) method.\n"
2709 <<
"Unknown constraints type.\n";
2711 throw std::logic_error(buffer.str());
2824 double objective = 0.0;
2836 case SUM_SQUARED_ERROR_OBJECTIVE:
2842 case MEAN_SQUARED_ERROR_OBJECTIVE:
2848 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
2854 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
2860 case MINKOWSKI_ERROR_OBJECTIVE:
2866 case CROSS_ENTROPY_ERROR_OBJECTIVE:
2872 case OUTPUTS_INTEGRALS_OBJECTIVE:
2878 case SOLUTIONS_ERROR_OBJECTIVE:
2884 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
2890 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
2896 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
2902 case USER_OBJECTIVE:
2910 std::ostringstream buffer;
2912 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
2913 <<
"double calculate_objective(void) const method.\n"
2914 <<
"Unknown objective type.\n";
2916 throw std::logic_error(buffer.str());
2940 double objective = 0.0;
2952 case SUM_SQUARED_ERROR_OBJECTIVE:
2958 case MEAN_SQUARED_ERROR_OBJECTIVE:
2964 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
2970 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
2976 case MINKOWSKI_ERROR_OBJECTIVE:
2982 case CROSS_ENTROPY_ERROR_OBJECTIVE:
2988 case OUTPUTS_INTEGRALS_OBJECTIVE:
2994 case SOLUTIONS_ERROR_OBJECTIVE:
3000 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
3006 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
3012 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
3018 case USER_OBJECTIVE:
3026 std::ostringstream buffer;
3028 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3029 <<
"double calculate_objective(const Vector<double>&) const method.\n"
3030 <<
"Unknown objective type.\n";
3032 throw std::logic_error(buffer.str());
3056 double regularization = 0.0;
3060 case NO_REGULARIZATION:
3066 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
3072 case OUTPUTS_INTEGRALS_REGULARIZATION:
3078 case USER_REGULARIZATION:
3086 std::ostringstream buffer;
3088 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3089 <<
"double calculate_regularization(void) const method.\n"
3090 <<
"Unknown regularization type.\n";
3092 throw std::logic_error(buffer.str());
3097 return(regularization);
3116 double regularization = 0.0;
3120 case NO_REGULARIZATION:
3126 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
3132 case OUTPUTS_INTEGRALS_REGULARIZATION:
3138 case USER_REGULARIZATION:
3146 std::ostringstream buffer;
3148 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3149 <<
"double calculate_regularization(const Vector<double>&) const method.\n"
3150 <<
"Unknown regularization type.\n";
3152 throw std::logic_error(buffer.str());
3157 return(regularization);
3176 double constraints = 0.0;
3182 case NO_CONSTRAINTS:
3188 case OUTPUTS_INTEGRALS_CONSTRAINTS:
3194 case SOLUTIONS_ERROR_CONSTRAINTS:
3200 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
3206 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
3212 case USER_CONSTRAINTS:
3220 std::ostringstream buffer;
3222 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3223 <<
"double calculate_constraints(void) const method.\n"
3224 <<
"Unknown constraints type.\n";
3226 throw std::logic_error(buffer.str());
3231 return(constraints);
3250 double constraints = 0.0;
3256 case NO_CONSTRAINTS:
3262 case OUTPUTS_INTEGRALS_CONSTRAINTS:
3268 case SOLUTIONS_ERROR_CONSTRAINTS:
3274 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
3280 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
3286 case USER_CONSTRAINTS:
3294 std::ostringstream buffer;
3296 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3297 <<
"double calculate_constraints(const Vector<double>&) const method.\n"
3298 <<
"Unknown constraints type.\n";
3300 throw std::logic_error(buffer.str());
3305 return(constraints);
3325 std::ostringstream buffer;
3343 case SUM_SQUARED_ERROR_OBJECTIVE:
3349 case MEAN_SQUARED_ERROR_OBJECTIVE:
3355 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
3357 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3358 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3359 <<
"Cannot calculate performance terms for root mean squared error objective.\n";
3361 throw std::logic_error(buffer.str());
3365 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
3371 case MINKOWSKI_ERROR_OBJECTIVE:
3373 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3374 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3375 <<
"Cannot calculate performance terms for Minkowski error objective.\n";
3377 throw std::logic_error(buffer.str());
3381 case OUTPUTS_INTEGRALS_OBJECTIVE:
3383 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3384 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3385 <<
"Cannot calculate performance terms for outputs integrals objective.\n";
3387 throw std::logic_error(buffer.str());
3391 case SOLUTIONS_ERROR_OBJECTIVE:
3393 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3394 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3395 <<
"Cannot calculate performance terms for solutions error objective.\n";
3397 throw std::logic_error(buffer.str());
3401 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
3403 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3404 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3405 <<
"Cannot calculate performance terms for final solutions error objective.\n";
3407 throw std::logic_error(buffer.str());
3411 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
3413 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3414 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3415 <<
"Cannot calculate performance terms for independent parameters error objective.\n";
3417 throw std::logic_error(buffer.str());
3421 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
3423 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3424 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3425 <<
"Cannot calculate performance terms for inverse sum squared error objective.\n";
3427 throw std::logic_error(buffer.str());
3431 case USER_OBJECTIVE:
3439 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3440 <<
"Vector<double> calculate_objective_terms(void) const method.\n"
3441 <<
"Unknown objective type.\n";
3443 throw std::logic_error(buffer.str());
3448 return(objective_terms);
3458 std::ostringstream buffer;
3464 case NO_REGULARIZATION:
3470 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
3472 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3473 <<
"Vector<double> calculate_regularization_terms(void) const method.\n"
3474 <<
"Cannot calculate performance terms for neural parameters norm.\n";
3476 throw std::logic_error(buffer.str());
3480 case OUTPUTS_INTEGRALS_REGULARIZATION:
3482 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3483 <<
"Vector<double> calculate_regularization_terms(void) const method.\n"
3484 <<
"Cannot calculate performance terms for outputs integrals.\n";
3486 throw std::logic_error(buffer.str());
3490 case USER_REGULARIZATION:
3498 std::ostringstream buffer;
3500 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3501 <<
"Vector<double> calculate_regularization_terms(void) const method.\n"
3502 <<
"Unknown regularization type.\n";
3504 throw std::logic_error(buffer.str());
3509 return(regularization_terms);
3521 std::ostringstream buffer;
3527 case NO_CONSTRAINTS:
3533 case OUTPUTS_INTEGRALS_CONSTRAINTS:
3535 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3536 <<
"Vector<double> calculate_constraints_terms(void) const method.\n"
3537 <<
"Cannot calculate performance terms for outputs integrals.\n";
3539 throw std::logic_error(buffer.str());
3543 case SOLUTIONS_ERROR_CONSTRAINTS:
3545 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3546 <<
"Vector<double> calculate_constraints_terms(void) const method.\n"
3547 <<
"Cannot calculate performance terms for solutions error.\n";
3549 throw std::logic_error(buffer.str());
3553 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
3555 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3556 <<
"Vector<double> calculate_constraints_terms(void) const method.\n"
3557 <<
"Cannot calculate performance terms for final solutions error.\n";
3559 throw std::logic_error(buffer.str());
3563 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
3565 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3566 <<
"Vector<double> calculate_constraints_terms(void) const method.\n"
3567 <<
"Cannot calculate performance terms for independent parameters error.\n";
3569 throw std::logic_error(buffer.str());
3573 case USER_CONSTRAINTS:
3581 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3582 <<
"Vector<double> calculate_constraints_terms(void) const method.\n"
3583 <<
"Unknown constraints type.\n";
3585 throw std::logic_error(buffer.str());
3590 return(constraints_terms);
3613 std::ostringstream buffer;
3627 case SUM_SQUARED_ERROR_OBJECTIVE:
3633 case MEAN_SQUARED_ERROR_OBJECTIVE:
3639 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
3641 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3642 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3643 <<
"Cannot calculate performance terms for root mean squared error objective.\n";
3645 throw std::logic_error(buffer.str());
3649 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
3655 case MINKOWSKI_ERROR_OBJECTIVE:
3657 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3658 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3659 <<
"Cannot calculate performance terms for Minkowski error objective.\n";
3661 throw std::logic_error(buffer.str());
3665 case OUTPUTS_INTEGRALS_OBJECTIVE:
3667 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3668 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3669 <<
"Cannot calculate performance terms for outputs integrals objective.\n";
3671 throw std::logic_error(buffer.str());
3675 case SOLUTIONS_ERROR_OBJECTIVE:
3677 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3678 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3679 <<
"Cannot calculate performance terms for solutions error objective.\n";
3681 throw std::logic_error(buffer.str());
3685 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
3687 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3688 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3689 <<
"Cannot calculate performance terms for final solutions error objective.\n";
3691 throw std::logic_error(buffer.str());
3695 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
3697 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3698 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3699 <<
"Cannot calculate performance terms for independent parameters error objective.\n";
3701 throw std::logic_error(buffer.str());
3705 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
3707 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3708 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3709 <<
"Cannot calculate performance terms for inverse sum squared error objective.\n";
3711 throw std::logic_error(buffer.str());
3715 case USER_OBJECTIVE:
3723 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3724 <<
"Matrix<double> calculate_objective_terms_Jacobian(void) const method.\n"
3725 <<
"Unknown objective type.\n";
3727 throw std::logic_error(buffer.str());
3732 return(objective_terms_Jacobian);
3749 std::ostringstream buffer;
3753 case NO_REGULARIZATION:
3759 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
3761 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3762 <<
"Matrix<double> calculate_regularization_terms_Jacobian(void) const method.\n"
3763 <<
"Cannot calculate performance terms for neural parameters norm.\n";
3765 throw std::logic_error(buffer.str());
3769 case OUTPUTS_INTEGRALS_REGULARIZATION:
3771 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3772 <<
"Matrix<double> calculate_regularization_terms_Jacobian(void) const method.\n"
3773 <<
"Cannot calculate performance terms for outputs integrals.\n";
3775 throw std::logic_error(buffer.str());
3779 case USER_REGULARIZATION:
3787 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3788 <<
"Matrix<double> calculate_regularization_terms_Jacobian(void) const method.\n"
3789 <<
"Unknown regularization type.\n";
3791 throw std::logic_error(buffer.str());
3796 return(regularization_terms_Jacobian);
3813 std::ostringstream buffer;
3819 case NO_CONSTRAINTS:
3825 case OUTPUTS_INTEGRALS_CONSTRAINTS:
3827 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3828 <<
"Matrix<double> calculate_constraints_terms_Jacobian(void) const method.\n"
3829 <<
"Cannot calculate performance terms for outputs integrals.\n";
3831 throw std::logic_error(buffer.str());
3835 case SOLUTIONS_ERROR_CONSTRAINTS:
3837 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3838 <<
"Matrix<double> calculate_constraints_terms_Jacobian(void) const method.\n"
3839 <<
"Cannot calculate performance terms for solutions error.\n";
3841 throw std::logic_error(buffer.str());
3845 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
3847 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3848 <<
"Matrix<double> calculate_constraints_terms_Jacobian(void) const method.\n"
3849 <<
"Cannot calculate performance terms for final solutions error.\n";
3851 throw std::logic_error(buffer.str());
3855 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
3857 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3858 <<
"Matrix<double> calculate_constraints_terms_Jacobian(void) const method.\n"
3859 <<
"Cannot calculate performance terms for independent parameters error.\n";
3861 throw std::logic_error(buffer.str());
3865 case USER_CONSTRAINTS:
3873 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3874 <<
"Matrix<double> calculate_constraints_terms_Jacobian(void) const method.\n"
3875 <<
"Unknown constraints type.\n";
3877 throw std::logic_error(buffer.str());
3882 return(constraints_terms_Jacobian);
3916 case SUM_SQUARED_ERROR_OBJECTIVE:
3922 case MEAN_SQUARED_ERROR_OBJECTIVE:
3928 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
3934 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
3940 case MINKOWSKI_ERROR_OBJECTIVE:
3946 case CROSS_ENTROPY_ERROR_OBJECTIVE:
3952 case OUTPUTS_INTEGRALS_OBJECTIVE:
3958 case SOLUTIONS_ERROR_OBJECTIVE:
3964 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
3970 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
3976 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
3982 case USER_OBJECTIVE:
3990 std::ostringstream buffer;
3992 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
3993 <<
"Vector<double> calculate_objective_gradient(void) const method.\n"
3994 <<
"Unknown objective type.\n";
3996 throw std::logic_error(buffer.str());
4035 case SUM_SQUARED_ERROR_OBJECTIVE:
4041 case MEAN_SQUARED_ERROR_OBJECTIVE:
4047 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
4053 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
4059 case MINKOWSKI_ERROR_OBJECTIVE:
4065 case CROSS_ENTROPY_ERROR_OBJECTIVE:
4071 case OUTPUTS_INTEGRALS_OBJECTIVE:
4077 case SOLUTIONS_ERROR_OBJECTIVE:
4083 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
4089 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
4095 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
4101 case USER_OBJECTIVE:
4109 std::ostringstream buffer;
4111 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4112 <<
"Vector<double> calculate_objective_gradient(const Vector<double>&) const method.\n"
4113 <<
"Unknown objective type.\n";
4115 throw std::logic_error(buffer.str());
4148 case NO_REGULARIZATION:
4154 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
4160 case OUTPUTS_INTEGRALS_REGULARIZATION:
4166 case USER_REGULARIZATION:
4174 std::ostringstream buffer;
4176 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4177 <<
"Vector<double> calculate_regularization_gradient(void) const method.\n"
4178 <<
"Unknown regularization type.\n";
4180 throw std::logic_error(buffer.str());
4213 case NO_REGULARIZATION:
4219 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
4225 case OUTPUTS_INTEGRALS_REGULARIZATION:
4231 case USER_REGULARIZATION:
4239 std::ostringstream buffer;
4241 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4242 <<
"Vector<double> calculate_regularization_gradient(const Vector<double>&) const method.\n"
4243 <<
"Unknown regularization type.\n";
4245 throw std::logic_error(buffer.str());
4278 case NO_CONSTRAINTS:
4284 case OUTPUTS_INTEGRALS_CONSTRAINTS:
4290 case SOLUTIONS_ERROR_CONSTRAINTS:
4296 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
4302 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
4308 case USER_CONSTRAINTS:
4316 std::ostringstream buffer;
4318 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4319 <<
"Vector<double> calculate_constraints_gradient(void) const method.\n"
4320 <<
"Unknown constraints type.\n";
4322 throw std::logic_error(buffer.str());
4355 case NO_CONSTRAINTS:
4361 case OUTPUTS_INTEGRALS_CONSTRAINTS:
4367 case SOLUTIONS_ERROR_CONSTRAINTS:
4373 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
4379 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
4385 case USER_CONSTRAINTS:
4393 std::ostringstream buffer;
4395 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4396 <<
"Vector<double> calculate_constraints_gradient(const Vector<double>&) const method.\n"
4397 <<
"Unknown constraints type.\n";
4399 throw std::logic_error(buffer.str());
4426 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4438 case SUM_SQUARED_ERROR_OBJECTIVE:
4444 case MEAN_SQUARED_ERROR_OBJECTIVE:
4450 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
4456 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
4462 case MINKOWSKI_ERROR_OBJECTIVE:
4468 case CROSS_ENTROPY_ERROR_OBJECTIVE:
4474 case OUTPUTS_INTEGRALS_OBJECTIVE:
4480 case SOLUTIONS_ERROR_OBJECTIVE:
4486 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
4492 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
4498 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
4504 case USER_OBJECTIVE:
4512 std::ostringstream buffer;
4514 buffer <<
"Matrix<double> Exception: PerformanceFunctional class.\n"
4515 <<
"Matrix<double> calculate_objective_Hessian(void) const method.\n"
4516 <<
"Unknown objective type.\n";
4518 throw std::logic_error(buffer.str());
4546 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4558 case SUM_SQUARED_ERROR_OBJECTIVE:
4564 case MEAN_SQUARED_ERROR_OBJECTIVE:
4570 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
4576 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
4582 case MINKOWSKI_ERROR_OBJECTIVE:
4588 case CROSS_ENTROPY_ERROR_OBJECTIVE:
4594 case OUTPUTS_INTEGRALS_OBJECTIVE:
4600 case SOLUTIONS_ERROR_OBJECTIVE:
4606 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
4612 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
4618 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
4624 case USER_OBJECTIVE:
4632 std::ostringstream buffer;
4634 buffer <<
"Matrix<double> Exception: PerformanceFunctional class.\n"
4635 <<
"Matrix<double> calculate_objective_Hessian(const Vector<double>&) const method.\n"
4636 <<
"Unknown objective type.\n";
4638 throw std::logic_error(buffer.str());
4665 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4671 case NO_REGULARIZATION:
4677 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
4683 case OUTPUTS_INTEGRALS_REGULARIZATION:
4689 case USER_REGULARIZATION:
4697 std::ostringstream buffer;
4699 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4700 <<
"Matrix<double> calculate_regularization_Hessian(void) const method.\n"
4701 <<
"Unknown regularization type.\n";
4703 throw std::logic_error(buffer.str());
4731 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4737 case NO_REGULARIZATION:
4743 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
4749 case OUTPUTS_INTEGRALS_REGULARIZATION:
4755 case USER_REGULARIZATION:
4763 std::ostringstream buffer;
4765 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4766 <<
"Matrix<double> calculate_regularization_Hessian(const Vector<double>&) const method.\n"
4767 <<
"Unknown regularization type.\n";
4769 throw std::logic_error(buffer.str());
4796 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4802 case NO_CONSTRAINTS:
4808 case OUTPUTS_INTEGRALS_CONSTRAINTS:
4814 case SOLUTIONS_ERROR_CONSTRAINTS:
4820 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
4826 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
4832 case USER_CONSTRAINTS:
4840 std::ostringstream buffer;
4842 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4843 <<
"Matrix<double> calculate_constraints_Hessian(void) const method.\n"
4844 <<
"Unknown constraints type.\n";
4846 throw std::logic_error(buffer.str());
4874 Matrix<double> Hessian(parameters_number, parameters_number, 0.0);
4880 case NO_CONSTRAINTS:
4886 case OUTPUTS_INTEGRALS_CONSTRAINTS:
4892 case SOLUTIONS_ERROR_CONSTRAINTS:
4898 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
4904 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
4910 case USER_CONSTRAINTS:
4918 std::ostringstream buffer;
4920 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4921 <<
"Matrix<double> calculate_constraints_Hessian(const Vector<double>&) const method.\n"
4922 <<
"Unknown constraints type.\n";
4924 throw std::logic_error(buffer.str());
4970 const size_t size = parameters.size();
4974 if(size != parameters_number)
4976 std::ostringstream buffer;
4978 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
4979 <<
"double calculate_performance(const Vector<double>&) method.\n"
4980 <<
"Size (" << size <<
") must be equal to number of parameters (" << parameters_number <<
").\n";
4982 throw std::logic_error(buffer.str());
4997 double generalization_objective = 0.0;
5007 case SUM_SQUARED_ERROR_OBJECTIVE:
5013 case MEAN_SQUARED_ERROR_OBJECTIVE:
5019 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
5025 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
5031 case MINKOWSKI_ERROR_OBJECTIVE:
5037 case CROSS_ENTROPY_ERROR_OBJECTIVE:
5043 case OUTPUTS_INTEGRALS_OBJECTIVE:
5049 case SOLUTIONS_ERROR_OBJECTIVE:
5055 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
5061 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
5067 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
5073 case USER_OBJECTIVE:
5081 std::ostringstream buffer;
5083 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5084 <<
"double calculate_generalization_objective(void) const method.\n"
5085 <<
"Unknown objective type.\n";
5087 throw std::logic_error(buffer.str());
5092 return(generalization_objective);
5102 double generalization_regularization = 0.0;
5106 case NO_REGULARIZATION:
5112 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
5118 case OUTPUTS_INTEGRALS_REGULARIZATION:
5124 case USER_REGULARIZATION:
5132 std::ostringstream buffer;
5134 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5135 <<
"double calculate_generalization_regularization(void) const method.\n"
5136 <<
"Unknown regularization type.\n";
5138 throw std::logic_error(buffer.str());
5143 return(generalization_regularization);
5153 double generalization_constraints = 0.0;
5157 case NO_CONSTRAINTS:
5163 case OUTPUTS_INTEGRALS_CONSTRAINTS:
5169 case SOLUTIONS_ERROR_CONSTRAINTS:
5175 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
5181 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
5187 case USER_CONSTRAINTS:
5195 std::ostringstream buffer;
5197 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5198 <<
"double calculate_generalization_constraints(void) const method.\n"
5199 <<
"Unknown constraints type.\n";
5201 throw std::logic_error(buffer.str());
5206 return(generalization_constraints);
5227 const double generalization_performance
5232 return(generalization_performance);
5276 const size_t size = parameters.size();
5278 if(size != parameters_number)
5280 std::ostringstream buffer;
5282 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5283 <<
"Vector<double> calculate_gradient(const Vector<double>&) const method.\n"
5284 <<
"Size (" << size <<
") must be equal to number of parameters (" << parameters_number <<
").\n";
5286 throw std::logic_error(buffer.str());
5333 const size_t size = parameters.size();
5336 if(size != parameters_number)
5338 std::ostringstream buffer;
5340 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5341 <<
"double calculate_Hessian(const Vector<double>&) method.\n"
5342 <<
"Size must be equal to number of parameters.\n";
5344 throw std::logic_error(buffer.str());
5376 return(objective_terms.
assemble(regularization_terms).
assemble(constraints_terms));
5409 return(objective_terms_Jacobian);
5421 std::ostringstream buffer;
5423 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5424 <<
"Matrix<double> calculate_inverse_Hessian(void) const method.\n"
5425 <<
"This method is not yet implemented.\n";
5427 throw std::logic_error(buffer.str());
5467 const size_t size = vector.size();
5471 if(size != parameters_number)
5473 std::ostringstream buffer;
5475 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5476 <<
"Vector<double> calculate_vector_dot_Hessian(Vector<double>) method.\n"
5477 <<
"Size of vector must be equal to number of parameters.\n";
5479 throw std::logic_error(buffer.str());
5486 return(vector_Hessian_product);
5500 return(zero_order_performance);
5515 return(first_order_performance);
5531 return(second_order_performance);
5558 const size_t parameters_size = parameters.size();
5561 if(parameters_size != parameters_number)
5563 std::ostringstream buffer;
5565 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5566 <<
"double calculate_first_order_Taylor_approximation(const Vector<double>&) const method.\n"
5567 <<
"Size of potential parameters must be equal to number of parameters.\n";
5569 throw std::logic_error(buffer.str());
5579 const double first_order_Taylor_approximation = performance + gradient.
dot(parameters-parameters);
5581 return(first_order_Taylor_approximation);
5597 const size_t parameters_size = parameters.size();
5600 if(parameters_size != parameters_number)
5602 std::ostringstream buffer;
5604 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5605 <<
"double calculate_second_order_Taylor_approximation(const Vector<double>&) const method.\n"
5606 <<
"Size of potential parameters must be equal to number of parameters.\n";
5608 throw std::logic_error(buffer.str());
5616 const Vector<double> parameters_difference = parameters - parameters;
5624 const double second_order_Taylor_approximation = performance
5625 + gradient.
dot(parameters_difference)
5626 + parameters_difference.
dot(Hessian).dot(parameters_difference)/2.0;
5628 return(second_order_Taylor_approximation);
5655 if(direction == 0.0)
5661 const Vector<double> potential_parameters = parameters + direction*rate;
5667 return(gradient.
dot(normalized_direction));
5679 if(direction == 0.0)
5685 const Vector<double> potential_parameters = parameters + direction*rate;
5691 return(normalized_direction.
dot(Hessian).dot(normalized_direction));
5702 std::ostringstream buffer;
5704 tinyxml2::XMLDocument* document =
new tinyxml2::XMLDocument;
5708 tinyxml2::XMLElement* performance_functional_element = document->NewElement(
"PerformanceFunctional");
5710 document->InsertFirstChild(performance_functional_element);
5718 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5719 performance_functional_element->LinkEndChild(objective_element);
5721 objective_element->SetAttribute(
"Type",
"NO_OBJECTIVE");
5725 case SUM_SQUARED_ERROR_OBJECTIVE:
5727 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5728 performance_functional_element->LinkEndChild(objective_element);
5730 objective_element->SetAttribute(
"Type",
"SUM_SQUARED_ERROR_OBJECTIVE");
5734 const tinyxml2::XMLElement* sum_squared_error_element = sum_squared_error_document->FirstChildElement(
"SumSquaredError");
5736 DeepClone(objective_element, sum_squared_error_element, document, NULL);
5738 delete sum_squared_error_document;
5742 case MEAN_SQUARED_ERROR_OBJECTIVE:
5744 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5745 performance_functional_element->LinkEndChild(objective_element);
5747 objective_element->SetAttribute(
"Type",
"MEAN_SQUARED_ERROR_OBJECTIVE");
5751 const tinyxml2::XMLElement* mean_squared_error_element = mean_squared_error_document->FirstChildElement(
"MeanSquaredError");
5753 DeepClone(objective_element, mean_squared_error_element, document, NULL);
5755 delete mean_squared_error_document;
5759 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
5761 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5762 performance_functional_element->LinkEndChild(objective_element);
5764 objective_element->SetAttribute(
"Type",
"ROOT_MEAN_SQUARED_ERROR_OBJECTIVE");
5768 const tinyxml2::XMLElement* root_mean_squared_error_element = root_mean_squared_error_document->FirstChildElement(
"RootMeanSquaredError");
5770 DeepClone(objective_element, root_mean_squared_error_element, document, NULL);
5772 delete root_mean_squared_error_document;
5776 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
5778 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5779 performance_functional_element->LinkEndChild(objective_element);
5781 objective_element->SetAttribute(
"Type",
"NORMALIZED_SQUARED_ERROR_OBJECTIVE");
5785 const tinyxml2::XMLElement* normalized_squared_error_element = normalized_squared_error_document->FirstChildElement(
"NormalizedSquaredError");
5787 DeepClone(objective_element, normalized_squared_error_element, document, NULL);
5789 delete normalized_squared_error_document;
5793 case MINKOWSKI_ERROR_OBJECTIVE:
5795 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5796 performance_functional_element->LinkEndChild(objective_element);
5798 objective_element->SetAttribute(
"Type",
"MINKOWSKI_ERROR_OBJECTIVE");
5802 const tinyxml2::XMLElement* Minkowski_error_element = Minkowski_error_document->FirstChildElement(
"MinkowskiError");
5804 DeepClone(objective_element, Minkowski_error_element, document, NULL);
5806 delete Minkowski_error_document;
5810 case CROSS_ENTROPY_ERROR_OBJECTIVE:
5812 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5813 performance_functional_element->LinkEndChild(objective_element);
5815 objective_element->SetAttribute(
"Type",
"CROSS_ENTROPY_ERROR_OBJECTIVE");
5819 const tinyxml2::XMLElement* cross_entropy_error_element = cross_entropy_error_document->FirstChildElement(
"CrossEntropyError");
5821 DeepClone(objective_element, cross_entropy_error_element, document, NULL);
5823 delete cross_entropy_error_document;
5827 case OUTPUTS_INTEGRALS_OBJECTIVE:
5829 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5830 performance_functional_element->LinkEndChild(objective_element);
5832 objective_element->SetAttribute(
"Type",
"OUTPUTS_INTEGRALS_OBJECTIVE");
5836 const tinyxml2::XMLElement* outputs_integrals_element = outputs_integrals_document->FirstChildElement(
"OutputsIntegrals");
5838 DeepClone(objective_element, outputs_integrals_element, document, NULL);
5840 delete outputs_integrals_document;
5844 case SOLUTIONS_ERROR_OBJECTIVE:
5846 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5847 performance_functional_element->LinkEndChild(objective_element);
5849 objective_element->SetAttribute(
"Type",
"SOLUTIONS_ERROR_OBJECTIVE");
5853 const tinyxml2::XMLElement* solutions_error_element = solutions_error_document->FirstChildElement(
"SolutionsError");
5855 DeepClone(objective_element, solutions_error_element, document, NULL);
5857 delete solutions_error_document;
5861 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
5863 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5864 performance_functional_element->LinkEndChild(objective_element);
5866 objective_element->SetAttribute(
"Type",
"FINAL_SOLUTIONS_ERROR_OBJECTIVE");
5870 const tinyxml2::XMLElement* final_solutions_error_element = final_solutions_error_document->FirstChildElement(
"FinalSolutionsError");
5872 DeepClone(objective_element, final_solutions_error_element, document, NULL);
5874 delete final_solutions_error_document;
5878 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
5880 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5881 performance_functional_element->LinkEndChild(objective_element);
5883 objective_element->SetAttribute(
"Type",
"INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE");
5887 const tinyxml2::XMLElement* independent_parameters_error_element = independent_parameters_error_document->FirstChildElement(
"IndependentParametersError");
5889 DeepClone(objective_element, independent_parameters_error_element, document, NULL);
5891 delete independent_parameters_error_document;
5895 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
5897 tinyxml2::XMLElement* objective_element = document->NewElement(
"Objective");
5898 performance_functional_element->LinkEndChild(objective_element);
5900 objective_element->SetAttribute(
"Type",
"INVERSE_SUM_SQUARED_ERROR_OBJECTIVE");
5904 const tinyxml2::XMLElement* inverse_sum_squared_error_element = inverse_sum_squared_error_document->FirstChildElement(
"InverseSumSquaredError");
5906 DeepClone(objective_element, inverse_sum_squared_error_element, document, NULL);
5908 delete inverse_sum_squared_error_document;
5912 case USER_OBJECTIVE:
5920 std::ostringstream buffer;
5922 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5923 <<
"tinyxml2::XMLDocument* to_XML(void) const method.\n"
5924 <<
"Unknown objective type.\n";
5926 throw std::logic_error(buffer.str());
5935 case NO_REGULARIZATION:
5937 tinyxml2::XMLElement* regularization_element = document->NewElement(
"Regularization");
5938 performance_functional_element->LinkEndChild(regularization_element);
5940 regularization_element->SetAttribute(
"Type",
"NO_REGULARIZATION");
5944 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
5946 tinyxml2::XMLElement* regularization_element = document->NewElement(
"Regularization");
5947 performance_functional_element->LinkEndChild(regularization_element);
5949 regularization_element->SetAttribute(
"Type",
"NEURAL_PARAMETERS_NORM_REGULARIZATION");
5953 const tinyxml2::XMLElement* neural_parameters_norm_element = neural_parameters_norm_document->FirstChildElement(
"NeuralParametersNorm");
5955 DeepClone(regularization_element, neural_parameters_norm_element, document, NULL);
5957 delete neural_parameters_norm_document;
5961 case OUTPUTS_INTEGRALS_REGULARIZATION:
5963 tinyxml2::XMLElement* regularization_element = document->NewElement(
"OUTPUTS_INTEGRALS_REGULARIZATION");
5964 performance_functional_element->LinkEndChild(regularization_element);
5966 regularization_element->SetAttribute(
"Type",
"NEURAL_PARAMETERS_NORM_REGULARIZATION");
5970 const tinyxml2::XMLElement* outputs_integrals_element = outputs_integrals_document->FirstChildElement(
"OutputsIntegrals");
5972 DeepClone(regularization_element, outputs_integrals_element, document, NULL);
5974 delete outputs_integrals_document;
5978 case USER_REGULARIZATION:
5986 std::ostringstream buffer;
5988 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
5989 <<
"tinyxml2::XMLDocument* to_XML(void) const method.\n"
5990 <<
"Unknown regularization type.\n";
5992 throw std::logic_error(buffer.str());
6001 case NO_CONSTRAINTS:
6007 case OUTPUTS_INTEGRALS_CONSTRAINTS:
6009 tinyxml2::XMLElement* constraints_element = document->NewElement(
"Constraints");
6010 performance_functional_element->LinkEndChild(constraints_element);
6011 constraints_element->SetAttribute(
"Type",
"OUTPUTS_INTEGRALS_CONSTRAINTS");
6015 const tinyxml2::XMLElement* outputs_integrals_element = outputs_integrals_document->FirstChildElement(
"OutputsIntegrals");
6017 DeepClone(constraints_element, outputs_integrals_element, document, NULL);
6019 delete outputs_integrals_document;
6023 case SOLUTIONS_ERROR_CONSTRAINTS:
6025 tinyxml2::XMLElement* constraints_element = document->NewElement(
"Constraints");
6026 performance_functional_element->LinkEndChild(constraints_element);
6028 constraints_element->SetAttribute(
"Type",
"SOLUTIONS_ERROR_CONSTRAINTS");
6032 const tinyxml2::XMLElement* solutions_error_element = solutions_error_document->FirstChildElement(
"SolutionsError");
6034 DeepClone(constraints_element, solutions_error_element, document, NULL);
6036 delete solutions_error_document;
6040 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
6042 tinyxml2::XMLElement* constraints_element = document->NewElement(
"Constraints");
6043 performance_functional_element->LinkEndChild(constraints_element);
6045 constraints_element->SetAttribute(
"Type",
"FINAL_SOLUTIONS_ERROR_CONSTRAINTS");
6049 const tinyxml2::XMLElement* final_solutions_error_element = final_solutions_error_document->FirstChildElement(
"FinalSolutionsError");
6051 DeepClone(constraints_element, final_solutions_error_element, document, NULL);
6053 delete final_solutions_error_document;
6058 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
6060 tinyxml2::XMLElement* constraints_element = document->NewElement(
"Constraints");
6061 performance_functional_element->LinkEndChild(constraints_element);
6063 constraints_element->SetAttribute(
"Type",
"INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS");
6067 const tinyxml2::XMLElement* independent_parameters_error_element = independent_parameters_error_document->FirstChildElement(
"FinalSolutionsError");
6069 DeepClone(constraints_element, independent_parameters_error_element, document, NULL);
6071 delete independent_parameters_error_document;
6076 case USER_CONSTRAINTS:
6084 std::ostringstream buffer;
6086 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6087 <<
"tinyxml2::XMLDocument* to_XML(void) const method.\n"
6088 <<
"Unknown constraints type.\n";
6090 throw std::logic_error(buffer.str());
6097 tinyxml2::XMLElement* display_element = document->NewElement(
"Display");
6098 performance_functional_element->LinkEndChild(display_element);
6103 tinyxml2::XMLText* display_text = document->NewText(buffer.str().c_str());
6104 display_element->LinkEndChild(display_text);
6117 const tinyxml2::XMLElement* performance_functional_element = document.FirstChildElement(
"PerformanceFunctional");
6119 if(!performance_functional_element)
6121 std::ostringstream buffer;
6123 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6124 <<
"void from_XML(const tinyxml2::XMLDocument&) method.\n"
6125 <<
"Performance functional element is NULL.\n";
6127 throw std::logic_error(buffer.str());
6132 const tinyxml2::XMLElement* objective_element = performance_functional_element->FirstChildElement(
"Objective");
6134 if(objective_element)
6136 const std::string new_objective_type = objective_element->Attribute(
"Type");
6148 case SUM_SQUARED_ERROR_OBJECTIVE:
6150 tinyxml2::XMLDocument new_document;
6152 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"SumSquaredError");
6153 new_document.InsertFirstChild(element_clone);
6155 DeepClone(element_clone, objective_element, &new_document, NULL);
6161 case MEAN_SQUARED_ERROR_OBJECTIVE:
6163 tinyxml2::XMLDocument new_document;
6165 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"MeanSquaredError");
6166 new_document.InsertFirstChild(element_clone);
6168 DeepClone(element_clone, objective_element, &new_document, NULL);
6174 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
6176 tinyxml2::XMLDocument new_document;
6178 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"RootMeanSquaredError");
6179 new_document.InsertFirstChild(element_clone);
6181 DeepClone(element_clone, objective_element, &new_document, NULL);
6187 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
6189 tinyxml2::XMLDocument new_document;
6191 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"NormalizedSquaredError");
6192 new_document.InsertFirstChild(element_clone);
6194 DeepClone(element_clone, objective_element, &new_document, NULL);
6200 case MINKOWSKI_ERROR_OBJECTIVE:
6202 tinyxml2::XMLDocument new_document;
6204 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"MinkowskiError");
6205 new_document.InsertFirstChild(element_clone);
6207 DeepClone(element_clone, objective_element, &new_document, NULL);
6213 case CROSS_ENTROPY_ERROR_OBJECTIVE:
6215 tinyxml2::XMLDocument new_document;
6217 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"CrossEntropyError");
6218 new_document.InsertFirstChild(element_clone);
6220 DeepClone(element_clone, objective_element, &new_document, NULL);
6226 case OUTPUTS_INTEGRALS_OBJECTIVE:
6228 tinyxml2::XMLDocument new_document;
6230 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"OutputsIntegralsError");
6231 new_document.InsertFirstChild(element_clone);
6233 DeepClone(element_clone, objective_element, &new_document, NULL);
6239 case SOLUTIONS_ERROR_OBJECTIVE:
6241 tinyxml2::XMLDocument new_document;
6243 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"SolutionsError");
6244 new_document.InsertFirstChild(element_clone);
6246 DeepClone(element_clone, objective_element, &new_document, NULL);
6252 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
6254 tinyxml2::XMLDocument new_document;
6256 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"FinalSolutionsError");
6257 new_document.InsertFirstChild(element_clone);
6259 DeepClone(element_clone, objective_element, &new_document, NULL);
6265 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
6267 tinyxml2::XMLDocument new_document;
6269 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"IndependentParametersError");
6270 new_document.InsertFirstChild(element_clone);
6272 DeepClone(element_clone, objective_element, &new_document, NULL);
6278 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
6280 tinyxml2::XMLDocument new_document;
6282 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"InverseSumSquaredError");
6283 new_document.InsertFirstChild(element_clone);
6285 DeepClone(element_clone, objective_element, &new_document, NULL);
6291 case USER_OBJECTIVE:
6299 std::ostringstream buffer;
6301 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6302 <<
"void from_XML(const tinyxml2::XMLDocument&) method.\n"
6303 <<
"Unknown objective type.\n";
6305 throw std::logic_error(buffer.str());
6313 const tinyxml2::XMLElement* regularization_element = performance_functional_element->FirstChildElement(
"Regularization");
6315 if(regularization_element)
6317 const std::string new_regularization_type = regularization_element->Attribute(
"Type");
6323 case NO_REGULARIZATION:
6329 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
6331 tinyxml2::XMLDocument new_document;
6333 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"NeuralParametersNorm");
6334 new_document.InsertFirstChild(element_clone);
6336 DeepClone(element_clone, regularization_element, &new_document, NULL);
6342 case OUTPUTS_INTEGRALS_REGULARIZATION:
6344 tinyxml2::XMLDocument new_document;
6346 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"OutputsIntegrals");
6347 new_document.InsertFirstChild(element_clone);
6349 DeepClone(element_clone, regularization_element, &new_document, NULL);
6355 case USER_REGULARIZATION:
6363 std::ostringstream buffer;
6365 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6366 <<
"void from_XML(const tinyxml2::XMLDocument&) method.\n"
6367 <<
"Unknown regularization type.\n";
6369 throw std::logic_error(buffer.str());
6376 const tinyxml2::XMLElement* constraints_element = performance_functional_element->FirstChildElement(
"Constraints");
6378 if(constraints_element)
6380 const std::string new_constraints_type = constraints_element->Attribute(
"Type");
6386 case NO_CONSTRAINTS:
6392 case OUTPUTS_INTEGRALS_CONSTRAINTS:
6394 tinyxml2::XMLDocument new_document;
6396 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"OutputsIntegrals");
6397 new_document.InsertFirstChild(element_clone);
6399 DeepClone(element_clone, constraints_element, &new_document, NULL);
6405 case SOLUTIONS_ERROR_CONSTRAINTS:
6407 tinyxml2::XMLDocument new_document;
6409 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"SolutionsError");
6410 new_document.InsertFirstChild(element_clone);
6412 DeepClone(element_clone, constraints_element, &new_document, NULL);
6418 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
6420 tinyxml2::XMLDocument new_document;
6422 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"FinalSolutionsError");
6423 new_document.InsertFirstChild(element_clone);
6425 DeepClone(element_clone, constraints_element, &new_document, NULL);
6431 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
6433 tinyxml2::XMLDocument new_document;
6435 tinyxml2::XMLElement* element_clone = new_document.NewElement(
"IndependentParametersError");
6436 new_document.InsertFirstChild(element_clone);
6438 DeepClone(element_clone, constraints_element, &new_document, NULL);
6444 case USER_CONSTRAINTS:
6452 std::ostringstream buffer;
6454 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6455 <<
"void from_XML(const tinyxml2::XMLDocument&) method.\n"
6456 <<
"Unknown constraints type.\n";
6458 throw std::logic_error(buffer.str());
6465 const tinyxml2::XMLElement* display_element = performance_functional_element->FirstChildElement(
"Display");
6469 std::string new_display_string = display_element->GetText();
6475 catch(
const std::logic_error& e)
6477 std::cout << e.what() << std::endl;
6489 std::ostringstream buffer;
6491 buffer <<
"Performance functional\n"
6504 case SUM_SQUARED_ERROR_OBJECTIVE:
6510 case MEAN_SQUARED_ERROR_OBJECTIVE:
6516 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
6522 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
6528 case MINKOWSKI_ERROR_OBJECTIVE:
6534 case CROSS_ENTROPY_ERROR_OBJECTIVE:
6540 case OUTPUTS_INTEGRALS_OBJECTIVE:
6546 case SOLUTIONS_ERROR_OBJECTIVE:
6552 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
6558 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
6564 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
6570 case USER_OBJECTIVE:
6580 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6581 <<
"std::string to_string(void) method.\n"
6582 <<
"Unknown objective type.\n";
6584 throw std::logic_error(buffer.str());
6595 case NO_REGULARIZATION:
6601 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
6607 case OUTPUTS_INTEGRALS_REGULARIZATION:
6613 case USER_REGULARIZATION:
6623 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6624 <<
"std::string to_string(void) method.\n"
6625 <<
"Unknown regularization type.\n";
6627 throw std::logic_error(buffer.str());
6638 case NO_CONSTRAINTS:
6644 case OUTPUTS_INTEGRALS_CONSTRAINTS:
6650 case SOLUTIONS_ERROR_CONSTRAINTS:
6656 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
6662 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
6668 case USER_CONSTRAINTS:
6678 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6679 <<
"std::string to_string(void) method.\n"
6680 <<
"Unknown constraints type.\n";
6682 throw std::logic_error(buffer.str());
6687 buffer <<
"Display:" <<
display <<
"\n";
6689 return(buffer.str());
6700 tinyxml2::XMLDocument* document =
to_XML();
6709 document->SaveFile(file_name.c_str());
6722 std::ostringstream buffer;
6724 tinyxml2::XMLDocument document;
6726 if(document.LoadFile(file_name.c_str()))
6728 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6729 <<
"void load(const std::string&) method.\n"
6730 <<
"Cannot load XML file " << file_name <<
".\n";
6732 throw std::logic_error(buffer.str());
6746 std::ostringstream buffer;
6758 case SUM_SQUARED_ERROR_OBJECTIVE:
6764 case MEAN_SQUARED_ERROR_OBJECTIVE:
6770 case ROOT_MEAN_SQUARED_ERROR_OBJECTIVE:
6776 case NORMALIZED_SQUARED_ERROR_OBJECTIVE:
6782 case MINKOWSKI_ERROR_OBJECTIVE:
6788 case CROSS_ENTROPY_ERROR_OBJECTIVE:
6794 case OUTPUTS_INTEGRALS_OBJECTIVE:
6800 case SOLUTIONS_ERROR_OBJECTIVE:
6806 case FINAL_SOLUTIONS_ERROR_OBJECTIVE:
6812 case INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE:
6818 case INVERSE_SUM_SQUARED_ERROR_OBJECTIVE:
6824 case USER_OBJECTIVE:
6834 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6835 <<
"std::string write_information(void) method.\n"
6836 <<
"Unknown objective type.\n";
6838 throw std::logic_error(buffer.str());
6847 case NO_REGULARIZATION:
6853 case NEURAL_PARAMETERS_NORM_REGULARIZATION:
6859 case OUTPUTS_INTEGRALS_REGULARIZATION:
6865 case USER_REGULARIZATION:
6875 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6876 <<
"std::string write_information(void) method.\n"
6877 <<
"Unknown regularization type.\n";
6879 throw std::logic_error(buffer.str());
6888 case NO_CONSTRAINTS:
6894 case OUTPUTS_INTEGRALS_CONSTRAINTS:
6900 case SOLUTIONS_ERROR_CONSTRAINTS:
6906 case FINAL_SOLUTIONS_ERROR_CONSTRAINTS:
6912 case INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS:
6918 case USER_CONSTRAINTS:
6928 buffer <<
"OpenNN Exception: PerformanceFunctional class.\n"
6929 <<
"std::string write_information(void) method.\n"
6930 <<
"Unknown constraints type.\n";
6932 throw std::logic_error(buffer.str());
6937 return(buffer.str());
double calculate_performance(void) const
Returns the Minkowski error performance.
size_t count_parameters_number(void) const
double calculate_performance(void) const
Returns the performance value of a neural network according to the sum squared error on a data set...
Vector< double > calculate_gradient(void) const
double calculate_generalization_performance(void) const
Returns the sum squared error of the neural network measured on the generalization instances of the d...
Vector< double > calculate_terms(void) const
Matrix< double > calculate_Hessian(void) const
Returns the performance term Hessian.
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the solutions error object, in XML format.
std::string write_information(void) const
Matrix< double > calculate_Hessian(void) const
double calculate_performance(void) const
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
double calculate_generalization_performance(void) const
Returns the root mean squared error of the multilayer perceptron measured on the generalization insta...
Vector< double > arrange_parameters(void) const
double calculate_performance(void) const
Returns the performance value of the performance term.
Vector< double > calculate_gradient(void) const
size_t count_training_instances_number(void) const
Returns the number of instances in the data set which will be used for training.
Vector< double > calculate_gradient(void) const
double calculate_generalization_performance(void) const
Returns an performance of the performance term for generalization purposes.
tinyxml2::XMLDocument * to_XML(void) const
void from_XML(const tinyxml2::XMLDocument &)
void from_XML(const tinyxml2::XMLDocument &)
tinyxml2::XMLDocument * to_XML(void) const
tinyxml2::XMLDocument * to_XML(void) const
Vector< double > calculate_gradient(void) const
tinyxml2::XMLDocument * to_XML(void) const
Vector< double > calculate_gradient(void) const
double calculate_generalization_performance(void) const
void from_XML(const tinyxml2::XMLDocument &)
Vector< double > calculate_gradient(void) const
Matrix< double > calculate_Hessian(void) const
std::string write_information(void) const
void from_XML(const tinyxml2::XMLDocument &)
Vector< T > assemble(const Vector< T > &) const
double calculate_performance(void) const
Matrix< double > calculate_Hessian(void) const
std::string write_information(void) const
size_t count_generalization_instances_number(void) const
Returns the number of instances in the data set which will be used for generalization.
std::string write_information(void) const
double calculate_performance(void) const
Returns the dot product between the independent parameters vector and its targets vector...
Matrix< double > calculate_Hessian(void) const
Matrix< double > calculate_terms_Jacobian(void) const
void from_XML(const tinyxml2::XMLDocument &)
double calculate_norm(void) const
Returns the vector norm.
Matrix< double > calculate_Hessian(void) const
Matrix< double > calculate_terms_Jacobian(void) const
void set_mathematical_model_pointer(MathematicalModel *)
double calculate_generalization_performance(void) const
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
double calculate_performance(void) const
Returns the mean squared error of a neural network on a data set.
Vector< double > calculate_gradient(void) const
Calculates the gradient the root mean squared error funcion by means of the back-propagation algorith...
Matrix< double > calculate_Hessian(void) const
double calculate_generalization_performance(void) const
virtual double calculate_performance(void) const
Returns the objective value of a neural network according to the solutions error on a mathematical mo...
double dot(const Vector< double > &) const
double calculate_performance(void) const
Returns the performance value of a neural network according to the normalized squared error on a data...
tinyxml2::XMLDocument * to_XML(void) const
void from_XML(const tinyxml2::XMLDocument &)
Vector< double > calculate_gradient(void) const
Returns the performance term gradient.
tinyxml2::XMLDocument * to_XML(void) const
void from_XML(const tinyxml2::XMLDocument &)
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
double calculate_performance(void) const
double calculate_performance(void) const
double calculate_performance(void) const
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
double calculate_generalization_performance(void) const
Vector< double > calculate_terms(void) const
Calculates the squared error terms for each instance, and returns it in a vector of size the number t...
Matrix< double > calculate_Hessian(void) const
Matrix< double > calculate_Hessian(void) const
tinyxml2::XMLDocument * to_XML(void) const
std::string write_information(void) const
Vector< double > calculate_gradient(void) const
Matrix< double > calculate_terms_Jacobian(void) const
Vector< double > calculate_terms(void) const
void from_XML(const tinyxml2::XMLDocument &)
void from_XML(const tinyxml2::XMLDocument &)
void from_XML(const tinyxml2::XMLDocument &)
void from_XML(const tinyxml2::XMLDocument &)
const Instances & get_instances(void) const
Returns a constant reference to the instances object composing this data set object.