[mlpack-svn] master: Add implementation of the LayerTraits class. (bf2aa51)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Jan 1 17:12:42 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/fdd269c1477a637edc667854260037c6519d0673...6543eebbf7b72a692679414b3f51043cb17cbc72

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

commit bf2aa5138851b553b744b93aa5b6857a535c0f71
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Thu Jan 1 23:11:59 2015 +0100

    Add implementation of the LayerTraits class.


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

bf2aa5138851b553b744b93aa5b6857a535c0f71
 src/mlpack/methods/ann/layer/layer_traits.hpp | 44 +++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/src/mlpack/methods/ann/layer/layer_traits.hpp b/src/mlpack/methods/ann/layer/layer_traits.hpp
new file mode 100644
index 0000000..b414b05
--- /dev/null
+++ b/src/mlpack/methods/ann/layer/layer_traits.hpp
@@ -0,0 +1,44 @@
+/**
+ * @file layer_traits.hpp
+ * @author Marcus Edel
+ *
+ * This provides the LayerTraits class, a template class to get information
+ * about various layers.
+ */
+#ifndef __MLPACK_METHOS_ANN_LAYER_LAYER_TRAITS_HPP
+#define __MLPACK_METHOS_ANN_LAYER_LAYER_TRAITS_HPP
+
+namespace mlpack {
+namespace ann {
+
+/**
+ * This is a template class that can provide information about various layers.
+ * By default, this class will provide the weakest possible assumptions on
+ * layer, and each layer should override values as necessary.  If a layer
+ * doesn't need to override a value, then there's no need to write a LayerTraits
+ * specialization for that class.
+ */
+template<typename LayerType>
+class LayerTraits
+{
+ public:
+  /**
+   * This is true if the layer is a binary layer.
+   */
+  static const bool IsBinary = false;
+
+  /**
+   * This is true if the layer is an output layer.
+   */
+  static const bool IsOutputLayer = false;
+
+  /**
+   * This is true if the layer is a bias layer.
+   */
+  static const bool IsBiasLayer = false;
+};
+
+}; // namespace ann
+}; // namespace mlpack
+
+#endif




More information about the mlpack-svn mailing list