Skip to content
Snippets Groups Projects
Commit 4d04630e authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Fixed memory error in L-M method

parent 20e157a2
No related branches found
No related tags found
No related merge requests found
......@@ -50,10 +50,7 @@ arma::Mat<double>* lib4neuro::LevenbergMarquardt::LevenbergMarquardtImpl::get_Ja
size_t n_parameters = ef.get_dimension();
size_t n_data_points = ef.get_dataset()->get_n_elements();
// size_t input_dim = ef.get_network_instance()->get_n_inputs();
// size_t output_dim = ef.get_network_instance()->get_n_outputs();
std::vector<std::pair<std::vector<double>, std::vector<double>>>* data = ef.get_dataset()->get_data();
// std::vector<double>* parameters = ef.get_parameters();
std::vector<double> grad(n_parameters);
for(size_t i = 0; i < n_data_points; i++) {
......@@ -199,7 +196,7 @@ namespace lib4neuro {
}while(iter_counter++ < this->p_impl->maximum_niters);
/* Store the optimized parameters */
*this->p_impl->optimal_parameters = *params_current;
this->p_impl->optimal_parameters = params_current;
}
std::vector<double>* LevenbergMarquardt::get_parameters() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment