[mlpack] 223/324: Patch from Sumedh: fix some uninitialized values.
Barak A. Pearlmutter
barak+git at cs.nuim.ie
Sun Aug 17 08:22:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch svn-trunk
in repository mlpack.
commit 8e6e1dea1cad033f418e43a4d224fcc191fb48c4
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date: Fri Jul 25 21:23:36 2014 +0000
Patch from Sumedh: fix some uninitialized values.
git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16865 9d5b8971-822b-0410-80eb-d18c1038ef23
---
.../amf/termination_policies/complete_incremental_termination.hpp | 7 +++++--
.../amf/termination_policies/simple_tolerance_termination.hpp | 5 +++++
.../amf/termination_policies/validation_RMSE_termination.hpp | 4 ++++
.../methods/amf/update_rules/svd_complete_incremental_learning.hpp | 5 ++++-
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/mlpack/methods/amf/termination_policies/complete_incremental_termination.hpp b/src/mlpack/methods/amf/termination_policies/complete_incremental_termination.hpp
index b92c5de..8b45186 100644
--- a/src/mlpack/methods/amf/termination_policies/complete_incremental_termination.hpp
+++ b/src/mlpack/methods/amf/termination_policies/complete_incremental_termination.hpp
@@ -1,8 +1,6 @@
#ifndef COMPLETE_INCREMENTAL_TERMINATION_HPP_INCLUDED
#define COMPLETE_INCREMENTAL_TERMINATION_HPP_INCLUDED
-#include "amf/termination_policies/simple_tolerance_termination.hpp"
-
namespace mlpack
{
namespace amf
@@ -48,6 +46,11 @@ class CompleteIncrementalTermination
{
return iteration;
}
+
+ const size_t& MaxIterations()
+ {
+ return t_policy.MaxIterations();
+ }
private:
TerminationPolicy t_policy;
diff --git a/src/mlpack/methods/amf/termination_policies/simple_tolerance_termination.hpp b/src/mlpack/methods/amf/termination_policies/simple_tolerance_termination.hpp
index 15c5369..18fef4d 100644
--- a/src/mlpack/methods/amf/termination_policies/simple_tolerance_termination.hpp
+++ b/src/mlpack/methods/amf/termination_policies/simple_tolerance_termination.hpp
@@ -29,6 +29,11 @@ class SimpleToleranceTermination
reverseStepCount = 0;
this->V = &V;
+
+ c_index = 0;
+ c_indexOld = 0;
+
+ reverseStepCount = 0;
}
bool IsConverged(arma::mat& W, arma::mat& H)
diff --git a/src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp b/src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp
index fb4911a..f63be80 100644
--- a/src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp
+++ b/src/mlpack/methods/amf/termination_policies/validation_RMSE_termination.hpp
@@ -50,6 +50,10 @@ class ValidationRMSETermination
rmse = DBL_MAX;
rmseOld = DBL_MAX;
+
+ c_index = 0;
+ c_indexOld = 0;
+
reverseStepCount = 0;
isCopy = false;
}
diff --git a/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp b/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp
index 9540b62..6ff7b3f 100644
--- a/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp
+++ b/src/mlpack/methods/amf/update_rules/svd_complete_incremental_learning.hpp
@@ -2,7 +2,6 @@
#define SVD_COMPLETE_INCREMENTAL_LEARNING_HPP_INCLUDED
#include <mlpack/core.hpp>
-#include <vector>
namespace mlpack
{
@@ -21,6 +20,7 @@ class SVDCompleteIncrementalLearning
void Initialize(const MatType& dataset, const size_t rank)
{
+ (void)rank;
n = dataset.n_rows;
m = dataset.n_cols;
@@ -128,6 +128,7 @@ class SVDCompleteIncrementalLearning<arma::sp_mat>
void Initialize(const arma::sp_mat& dataset, const size_t rank)
{
+ (void)rank;
n = dataset.n_rows;
m = dataset.n_cols;
@@ -183,6 +184,8 @@ class SVDCompleteIncrementalLearning<arma::sp_mat>
const arma::mat& W,
arma::mat& H)
{
+ (void)V;
+
arma::mat deltaH(H.n_rows, 1);
deltaH.zeros();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list