Skip to content

Commit

Permalink
seeding fix for xvalmmd
Browse files Browse the repository at this point in the history
fix #4783
  • Loading branch information
vigsterkr committed Oct 23, 2019
1 parent 40f40f0 commit 9939a8d
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,11 @@ struct CrossValidationMMD : PermutationMMD
SGVector<int64_t> dummy_labels_x(m_n_x);
SGVector<int64_t> dummy_labels_y(m_n_y);

auto instance_x=new CCrossValidationSplitting(new CBinaryLabels(dummy_labels_x), m_num_folds);
auto instance_y=new CCrossValidationSplitting(new CBinaryLabels(dummy_labels_y), m_num_folds);
random::seed(instance_x, prng);
random::seed(instance_y, prng);

m_kfold_x=unique_ptr<CCrossValidationSplitting>(instance_x);
m_kfold_y=unique_ptr<CCrossValidationSplitting>(instance_y);
m_kfold_x=std::make_unique<CCrossValidationSplitting>(new CBinaryLabels(dummy_labels_x), m_num_folds);
m_kfold_y=std::make_unique<CCrossValidationSplitting>(new CBinaryLabels(dummy_labels_y), m_num_folds);
random::seed(m_kfold_x.get(), prng);
random::seed(m_kfold_y.get(), prng);

m_stack=unique_ptr<CSubsetStack>(new CSubsetStack());

const index_t size=m_n_x+m_n_y;
Expand Down

0 comments on commit 9939a8d

Please sign in to comment.