[mlpack-git] master: Add implementation of the LayerTraits class. (19597a8)

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


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

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

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

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

    Add implementation of the LayerTraits class.


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

19597a8a80e0d1d7cb59bc59e2be84468470d7f2
 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-git mailing list