[mlpack-git] master: Add implementation of the sum squared error performance function. (fffc5c7)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:10:11 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit fffc5c700c22f0777d569ee40a10da1e6ce22ff7
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Sat Jan 3 14:13:49 2015 +0100

    Add implementation of the sum squared error performance function.


>---------------------------------------------------------------

fffc5c700c22f0777d569ee40a10da1e6ce22ff7
 .../ann/performance_functions/sse_function.hpp     | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/src/mlpack/methods/ann/performance_functions/sse_function.hpp b/src/mlpack/methods/ann/performance_functions/sse_function.hpp
new file mode 100644
index 0000000..b88e5a2
--- /dev/null
+++ b/src/mlpack/methods/ann/performance_functions/sse_function.hpp
@@ -0,0 +1,42 @@
+/**
+ * @file sse_function.hpp
+ * @author Marcus Edel
+ *
+ * Definition and implementation of the sum squared error performance function.
+ */
+#ifndef __MLPACK_METHODS_ANN_PERFORMANCE_FUNCTIONS_SSE_FUNCTION_HPP
+#define __MLPACK_METHODS_ANN_PERFORMANCE_FUNCTIONS_SSE_FUNCTION_HPP
+
+#include <mlpack/core.hpp>
+
+namespace mlpack {
+namespace ann /** Artificial Neural Network. */ {
+
+/**
+ * The sum squared error performance function measures the network's performance
+ * according to the sum of squared errors.
+ *
+ * @tparam VecType Type of data (arma::colvec, arma::mat or arma::sp_mat).
+ */
+template<typename VecType = arma::colvec>
+class SumSquaredErrorFunction
+{
+  public:
+  /**
+   * Computes the sum squared error function.
+   *
+   * @param input Input data.
+   * @param target Target data.
+   * @return sum of squared errors.
+   */
+  static double error(const VecType& input, const VecType& target)
+  {
+    return arma::sum(arma::square(target - input));
+  }
+
+}; // class SumSquaredErrorFunction
+
+}; // namespace ann
+}; // namespace mlpack
+
+#endif



More information about the mlpack-git mailing list