-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using rvalue references to set a given reference tree in FastMKS and DualTreeBoruvka #799
Closed
Closed
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c488c34
Merge pull request #1 from mlpack/master
akanuraj200 e553685
Merge pull request #2 from mlpack/master
akanuraj200 7892ee1
Add support for rvalue references when setting a given reference tree…
d841f13
Add support for rvalue references when setting a given reference tree…
5c6a096
Merge branch 'master' of https://github.com/akanuraj200/mlpack
8bad384
Merge pull request #3 from mlpack/master
akanuraj200 1723e61
update fastmks_impl.hpp
akanuraj200 3b78840
fix memory leak in fastmks and other minor changes.
29e94a3
updated Train(Tree*) in FastMKS
1678ad9
Merge branch 'master' of https://github.com/akanuraj200/mlpack
427ca26
update FastMKS<>::Train(Tree&) and FastMKS<>::Train(Tree&&)
39b5395
Merge pull request #4 from mlpack/master
akanuraj200 ca1038f
avoided copying the entire tree in fastmks_model for speed improvement.
d444eef
Merge branch 'master' of git://github.com/mlpack/mlpack
de961f2
Merge branch 'master' of https://github.com/akanuraj200/mlpack
9d78642
Added mlpack_deprecated flags. Changed arguments like Tree& to const …
f8237ba
avoid deprecated methods inside FastMKS class
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ template<typename KernelType, | |
template<typename TreeMetricType, | ||
typename TreeStatType, | ||
typename TreeMatType> class TreeType> | ||
FastMKS<KernelType, MatType, TreeType>::FastMKS(Tree& referenceTree, | ||
FastMKS<KernelType, MatType, TreeType>::FastMKS(const Tree& referenceTree, | ||
const bool singleMode) : | ||
referenceTree(new Tree(referenceTree)), | ||
referenceSet(&this->referenceTree->Dataset()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't set |
||
|
@@ -225,7 +225,7 @@ template<typename KernelType, | |
template<typename TreeMetricType, | ||
typename TreeStatType, | ||
typename TreeMatType> class TreeType> | ||
void FastMKS<KernelType, MatType, TreeType>::Train(Tree& tree) | ||
void FastMKS<KernelType, MatType, TreeType>::Train(const Tree& tree) | ||
{ | ||
if (naive) | ||
throw std::invalid_argument("cannot call FastMKS::Train() with a tree when " | ||
|
@@ -358,7 +358,7 @@ void FastMKS<KernelType, MatType, TreeType>::Search( | |
Tree queryTree(querySet); | ||
Timer::Stop("tree_building"); | ||
|
||
Search(&queryTree, k, indices, kernels); | ||
Search(queryTree, k, indices, kernels); | ||
} | ||
|
||
template<typename KernelType, | ||
|
@@ -372,7 +372,7 @@ void FastMKS<KernelType, MatType, TreeType>::Search( | |
arma::Mat<size_t>& indices, | ||
arma::mat& kernels) | ||
{ | ||
Search(*queryTree, k, indices, kernels); | ||
Search(*queryTree, k, indices, kernels); | ||
} | ||
|
||
template<typename KernelType, | ||
|
@@ -505,7 +505,7 @@ void FastMKS<KernelType, MatType, TreeType>::Search( | |
// Dual-tree implementation. | ||
Timer::Stop("computing_products"); | ||
|
||
Search(std::move(referenceTree), k, indices, kernels); | ||
Search(*referenceTree, k, indices, kernels); | ||
} | ||
|
||
//! Serialize the model. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should mark this function deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To mark a method deprecated, also add
mlpack_deprecated
to the function definition please. i.e.mlpack_deprecated void Train(...)
.