Skip to content
Snippets Groups Projects
Commit 20d629f3 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Bug Fix: LossFunction _n_project set too late

fix that bug
parent da41d67d
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ void LossFunctionPearsonRMSE::set_nfeat(int n_feat) ...@@ -48,7 +48,7 @@ void LossFunctionPearsonRMSE::set_nfeat(int n_feat)
void LossFunctionPearsonRMSE::reset_projection_prop(const std::vector<std::vector<model_node_ptr>>& models) void LossFunctionPearsonRMSE::reset_projection_prop(const std::vector<std::vector<model_node_ptr>>& models)
{ {
_n_project_prop = models.size();
_projection_prop.resize(_n_samp * _n_project_prop); _projection_prop.resize(_n_samp * _n_project_prop);
for(int mm = 0; mm < _n_project_prop; ++mm) for(int mm = 0; mm < _n_project_prop; ++mm)
{ {
...@@ -57,7 +57,6 @@ void LossFunctionPearsonRMSE::reset_projection_prop(const std::vector<std::vecto ...@@ -57,7 +57,6 @@ void LossFunctionPearsonRMSE::reset_projection_prop(const std::vector<std::vecto
} }
set_nfeat(models.back().size() + 1); set_nfeat(models.back().size() + 1);
_n_project_prop = models.size();
prepare_project(); prepare_project();
} }
...@@ -116,6 +115,7 @@ double LossFunctionPearsonRMSE::project(const node_ptr& feat) ...@@ -116,6 +115,7 @@ double LossFunctionPearsonRMSE::project(const node_ptr& feat)
double LossFunctionPearsonRMSE::calc_max_pearson(double* feat_val_ptr) double LossFunctionPearsonRMSE::calc_max_pearson(double* feat_val_ptr)
{ {
std::cout << "TEST IN" << std::endl;
int start = 0; int start = 0;
for(int tt = 0; tt < _task_sizes_train.size(); ++tt) for(int tt = 0; tt < _task_sizes_train.size(); ++tt)
{ {
...@@ -145,6 +145,7 @@ double LossFunctionPearsonRMSE::calc_max_pearson(double* feat_val_ptr) ...@@ -145,6 +145,7 @@ double LossFunctionPearsonRMSE::calc_max_pearson(double* feat_val_ptr)
start += _task_sizes_train[tt]; start += _task_sizes_train[tt];
} }
std::cout << "TEST OUT" << std::endl;
return *std::max_element(_scores.begin(), _scores.end()) / static_cast<double>(-1 * _n_task); return *std::max_element(_scores.begin(), _scores.end()) / static_cast<double>(-1 * _n_task);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment