From 405c4ee2549d8425e413c1b86e6efb3e0515da26 Mon Sep 17 00:00:00 2001
From: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Date: Fri, 19 Jun 2020 18:10:57 -0400
Subject: [PATCH 1/5] update image and details section of documentation
---
machine_learning/adaline_learning.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/machine_learning/adaline_learning.cpp b/machine_learning/adaline_learning.cpp
index 1e25d3ba1..a8426ac4e 100644
--- a/machine_learning/adaline_learning.cpp
+++ b/machine_learning/adaline_learning.cpp
@@ -7,10 +7,12 @@
*
* \author [Krishna Vedala](https://github.com/kvedala)
*
- *
- * [source](https://commons.wikimedia.org/wiki/File:Adaline_flow_chart.gif)
+ * alt="Structure of an ADALINE network. Source: Wikipedia"
+ * style="width:200px; float:right;">
+ *
* ADALINE is one of the first and simplest single layer artificial neural
* network. The algorithm essentially implements a linear function
* \f[ f\left(x_0,x_1,x_2,\ldots\right) =
From ba2f1ed12d85d03f5d47ec4f75be99648ad1f9e3 Mon Sep 17 00:00:00 2001
From: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Date: Fri, 19 Jun 2020 18:12:35 -0400
Subject: [PATCH 2/5] update documentation
---
machine_learning/kohonen_som_topology.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/machine_learning/kohonen_som_topology.cpp b/machine_learning/kohonen_som_topology.cpp
index 25c58e260..016fe6d1e 100644
--- a/machine_learning/kohonen_som_topology.cpp
+++ b/machine_learning/kohonen_som_topology.cpp
@@ -3,9 +3,11 @@
* @{
* \file
* \author [Krishna Vedala](https://github.com/kvedala)
+ *
* \brief [Kohonen self organizing
* map](https://en.wikipedia.org/wiki/Self-organizing_map) (topological map)
*
+ * \details
* This example implements a powerful unsupervised learning algorithm called as
* a self organizing map. The algorithm creates a connected network of weights
* that closely follows the given data points. This thus creates a topological
@@ -21,7 +23,7 @@
* than with GCC on windows
* \see kohonen_som_trace.cpp
*/
-#define _USE_MATH_DEFINES // required for MS Visual C++
+#define _USE_MATH_DEFINES //< required for MS Visual C++
#include
#include
#include
From 2ad1b72f6c4ea0b63e01e3fa83924095789b43dd Mon Sep 17 00:00:00 2001
From: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Date: Fri, 19 Jun 2020 18:17:16 -0400
Subject: [PATCH 3/5] make epsilon equal system epsilon
---
numerical_methods/newton_raphson_method.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/numerical_methods/newton_raphson_method.cpp b/numerical_methods/newton_raphson_method.cpp
index d086123ca..45560e323 100644
--- a/numerical_methods/newton_raphson_method.cpp
+++ b/numerical_methods/newton_raphson_method.cpp
@@ -18,7 +18,7 @@
#include
#define EPSILON \
- 1e-6 // std::numeric_limits::epsilon() ///< system accuracy limit
+ std::numeric_limits::epsilon() ///< system accuracy limit
#define MAX_ITERATIONS 50000 ///< Maximum number of iterations to check
/** define \f$f(x)\f$ to find root for
From 5111c2cf599ab3fbd89b97cd190f34814a03f60f Mon Sep 17 00:00:00 2001
From: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Date: Fri, 19 Jun 2020 18:19:20 -0400
Subject: [PATCH 4/5] set author after program details
---
numerical_methods/ordinary_least_squares_regressor.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/numerical_methods/ordinary_least_squares_regressor.cpp b/numerical_methods/ordinary_least_squares_regressor.cpp
index 43979d0ea..bbd75a742 100644
--- a/numerical_methods/ordinary_least_squares_regressor.cpp
+++ b/numerical_methods/ordinary_least_squares_regressor.cpp
@@ -3,10 +3,11 @@
* \brief Linear regression example using [Ordinary least
* squares](https://en.wikipedia.org/wiki/Ordinary_least_squares)
*
- * \author [Krishna Vedala](https://github.com/kvedala)
* Program that gets the number of data samples and number of features per
* sample along with output per sample. It applies OLS regression to compute
* the regression output for additional test data samples.
+ *
+ * \author [Krishna Vedala](https://github.com/kvedala)
*/
#include // for print formatting
#include
From 00fab77412da2ad4304faa8227e7ccce8ee8139d Mon Sep 17 00:00:00 2001
From: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
Date: Fri, 19 Jun 2020 18:26:15 -0400
Subject: [PATCH 5/5] set epsilon to 1e-10 and update documentation
---
numerical_methods/newton_raphson_method.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/numerical_methods/newton_raphson_method.cpp b/numerical_methods/newton_raphson_method.cpp
index 45560e323..7597f1b8a 100644
--- a/numerical_methods/newton_raphson_method.cpp
+++ b/numerical_methods/newton_raphson_method.cpp
@@ -17,17 +17,24 @@
#include
#include
-#define EPSILON \
- std::numeric_limits::epsilon() ///< system accuracy limit
-#define MAX_ITERATIONS 50000 ///< Maximum number of iterations to check
+#define EPSILON 1e-10 ///< system accuracy limit
+#define MAX_ITERATIONS INT16_MAX ///< Maximum number of iterations to check
-/** define \f$f(x)\f$ to find root for
+/** define \f$f(x)\f$ to find root for.
+ * Currently defined as:
+ * \f[
+ * f(x) = x^3 - 4x - 9
+ * \f]
*/
static double eq(double i) {
return (std::pow(i, 3) - (4 * i) - 9); // original equation
}
/** define the derivative function \f$f'(x)\f$
+ * For the current problem, it is:
+ * \f[
+ * f'(x) = 3x^2 - 4
+ * \f]
*/
static double eq_der(double i) {
return ((3 * std::pow(i, 2)) - 4); // derivative of equation