[mlpack-svn] master: Add implementation of the sum squared error performance function. (1e54ceb)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Jan 6 14:20:48 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/6b14d78fc09cb205ffa7a297f5e6310b2ad83e25...9147fd3ee8072669c18422de4ea6fbe8f964b423

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

commit 1e54ceb9dbe9effba0b869638a49c2b526d0de05
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.


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

1e54ceb9dbe9effba0b869638a49c2b526d0de05
 .../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