[mlpack-git] master: Use Row instead of Col. (439fec9)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Fri Dec 11 12:46:54 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/dd7c8b93fe5f299cb534cda70c1c786456f9a78f...3b926fd86ab143eb8af7327b9fb89fead7538df0
>---------------------------------------------------------------
commit 439fec9164c76d5793b1bb03eb2f540854f411e6
Author: Ryan Curtin <ryan at ratml.org>
Date: Fri Dec 11 02:51:12 2015 +0000
Use Row instead of Col.
>---------------------------------------------------------------
439fec9164c76d5793b1bb03eb2f540854f411e6
src/mlpack/core/data/normalize_labels.hpp | 10 +++++-----
src/mlpack/core/data/normalize_labels_impl.hpp | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/mlpack/core/data/normalize_labels.hpp b/src/mlpack/core/data/normalize_labels.hpp
index 89e5a27..360869f 100644
--- a/src/mlpack/core/data/normalize_labels.hpp
+++ b/src/mlpack/core/data/normalize_labels.hpp
@@ -24,9 +24,9 @@ namespace data {
* @param labels Vector that unsigned labels will be stored in.
* @param mapping Reverse mapping to convert new labels back to old labels.
*/
-template<typename eT>
-void NormalizeLabels(const arma::Col<eT>& labelsIn,
- arma::Col<size_t>& labels,
+template<typename eT, typename RowType>
+void NormalizeLabels(const RowType& labelsIn,
+ arma::Row<size_t>& labels,
arma::Col<eT>& mapping);
/**
@@ -38,9 +38,9 @@ void NormalizeLabels(const arma::Col<eT>& labelsIn,
* @param labelsOut Vector to store new labels in.
*/
template<typename eT>
-void RevertLabels(const arma::Col<size_t>& labels,
+void RevertLabels(const arma::Row<size_t>& labels,
const arma::Col<eT>& mapping,
- arma::Col<eT>& labelsOut);
+ arma::Row<eT>& labelsOut);
} // namespace data
} // namespace mlpack
diff --git a/src/mlpack/core/data/normalize_labels_impl.hpp b/src/mlpack/core/data/normalize_labels_impl.hpp
index bdb49c6..920fa2c 100644
--- a/src/mlpack/core/data/normalize_labels_impl.hpp
+++ b/src/mlpack/core/data/normalize_labels_impl.hpp
@@ -24,9 +24,9 @@ namespace data {
* @param labels Vector that unsigned labels will be stored in.
* @param mapping Reverse mapping to convert new labels back to old labels.
*/
-template<typename eT>
-void NormalizeLabels(const arma::Col<eT>& labelsIn,
- arma::Col<size_t>& labels,
+template<typename eT, typename RowType>
+void NormalizeLabels(const RowType& labelsIn,
+ arma::Row<size_t>& labels,
arma::Col<eT>& mapping)
{
// Loop over the input labels, and develop the mapping. We'll first naively
@@ -71,9 +71,9 @@ void NormalizeLabels(const arma::Col<eT>& labelsIn,
* @param labelsOut Vector to store new labels in.
*/
template<typename eT>
-void RevertLabels(const arma::Col<size_t>& labels,
+void RevertLabels(const arma::Row<size_t>& labels,
const arma::Col<eT>& mapping,
- arma::Col<eT>& labelsOut)
+ arma::Row<eT>& labelsOut)
{
// We already have the mapping, so we just need to loop over each element.
labelsOut.set_size(labels.n_elem);
More information about the mlpack-git
mailing list