diff --git a/src/mlpack/core/kernels/epanechnikov_kernel.cpp b/src/mlpack/core/kernels/epanechnikov_kernel.cpp index b3d7fc3cc4..408e6de430 100644 --- a/src/mlpack/core/kernels/epanechnikov_kernel.cpp +++ b/src/mlpack/core/kernels/epanechnikov_kernel.cpp @@ -66,7 +66,7 @@ double EpanechnikovKernel::GradientForSquaredDistance(const double if (distanceSquared < bandwidthSquared) { return -1 * inverseBandwidthSquared; - } + } else if (distanceSquared > bandwidthSquared && distanceSquared >= 0) { diff --git a/src/mlpack/methods/ann/augmented/tasks/add_impl.hpp b/src/mlpack/methods/ann/augmented/tasks/add_impl.hpp index b9747587ca..8c9f9bce40 100644 --- a/src/mlpack/methods/ann/augmented/tasks/add_impl.hpp +++ b/src/mlpack/methods/ann/augmented/tasks/add_impl.hpp @@ -149,4 +149,4 @@ const void AddTask::Binarize(const arma::field& input, } // namespace augmented } // namespace ann } // namespace mlpack -#endif \ No newline at end of file +#endif diff --git a/src/mlpack/methods/ann/augmented/tasks/copy.hpp b/src/mlpack/methods/ann/augmented/tasks/copy.hpp index 5088414fae..7d37d093f5 100644 --- a/src/mlpack/methods/ann/augmented/tasks/copy.hpp +++ b/src/mlpack/methods/ann/augmented/tasks/copy.hpp @@ -70,7 +70,7 @@ class CopyTask arma::field& labels, const size_t batchSize, bool fixedLength = false); - + /** * Generate dataset of a given size and store it in * arma::mat object. diff --git a/src/mlpack/methods/ann/augmented/tasks/copy_impl.hpp b/src/mlpack/methods/ann/augmented/tasks/copy_impl.hpp index d3b5a66c03..354a565a54 100644 --- a/src/mlpack/methods/ann/augmented/tasks/copy_impl.hpp +++ b/src/mlpack/methods/ann/augmented/tasks/copy_impl.hpp @@ -27,7 +27,7 @@ CopyTask::CopyTask(const size_t maxLength, nRepeats(nRepeats), addSeparator(addSeparator) { - if (maxLength <= 1) + if (maxLength <= 1) { std::ostringstream oss; oss << "CopyTask::CopyTask(): maximum sequence length (" @@ -58,7 +58,7 @@ const void CopyTask::Generate(arma::field& input, for (size_t i = 0; i < batchSize; ++i) { if (!fixedLength) - { + { arma::vec weights(maxLength - 1); // We have two binary numbers with exactly two digits (10 and 11). // Increasing length by 1 double the number of valid numbers. diff --git a/src/mlpack/methods/ann/augmented/tasks/score_impl.hpp b/src/mlpack/methods/ann/augmented/tasks/score_impl.hpp index d3e4638bea..fcf6362b91 100644 --- a/src/mlpack/methods/ann/augmented/tasks/score_impl.hpp +++ b/src/mlpack/methods/ann/augmented/tasks/score_impl.hpp @@ -35,7 +35,7 @@ const double SequencePrecision(arma::field trueOutputs, << "of ground-truth sequences (" << trueOutputs.n_elem << ")" << std::endl; - throw std::invalid_argument(oss.str()); + throw std::invalid_argument(oss.str()); } for (size_t i = 0; i < testSize; i++) diff --git a/src/mlpack/tests/random_test.cpp b/src/mlpack/tests/random_test.cpp index 27b5bf7303..c3d5b00e58 100644 --- a/src/mlpack/tests/random_test.cpp +++ b/src/mlpack/tests/random_test.cpp @@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(DiscreteUniformRandomTest) BOOST_REQUIRE_SMALL( 1.0 / (hiExclusive - lo) - count[i] * 1.0 / iterations, 1e-2); } - } + } // Here we also test RandInt(hiExclusive) overload. for (std::pair range : ranges)