[mlpack-git] master: Add the convolution neural network to the network traits. (b0ab609)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue May 5 16:16:14 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/9c34c98c8dad01b4ad659c37367a8b20287b6b5a...237ab40b5a32dd626a387e8a109771307fe59153

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

commit b0ab6098709e6b3f5b7cdcb7f7524d2f7e3e88b7
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Tue May 5 22:09:42 2015 +0200

    Add the convolution neural network to the network traits.


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

b0ab6098709e6b3f5b7cdcb7f7524d2f7e3e88b7
 src/mlpack/methods/ann/ffnn.hpp            | 3 ++-
 src/mlpack/methods/ann/network_traits.hpp  | 5 +++++
 src/mlpack/methods/ann/rnn.hpp             | 5 +++--
 src/mlpack/methods/ann/trainer/trainer.hpp | 3 ++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/ann/ffnn.hpp b/src/mlpack/methods/ann/ffnn.hpp
index 12cc107..9711078 100644
--- a/src/mlpack/methods/ann/ffnn.hpp
+++ b/src/mlpack/methods/ann/ffnn.hpp
@@ -40,7 +40,7 @@ class FFNN
      * Construct the FFNN object, which will construct a feed forward neural
      * network with the specified layers.
      *
-     * @param network The network modules used to construct net network.
+     * @param network The network modules used to construct the network.
      * @param outputLayer The outputlayer used to evaluate the network.
      */
     FFNN(const ConnectionTypes& network, OutputLayerType& outputLayer)
@@ -497,6 +497,7 @@ class NetworkTraits<
  public:
   static const bool IsFNN = true;
   static const bool IsRNN = false;
+  static const bool IsCNN = false;
 };
 
 }; // namespace ann
diff --git a/src/mlpack/methods/ann/network_traits.hpp b/src/mlpack/methods/ann/network_traits.hpp
index 4c74f9a..962820a 100644
--- a/src/mlpack/methods/ann/network_traits.hpp
+++ b/src/mlpack/methods/ann/network_traits.hpp
@@ -31,6 +31,11 @@ class NetworkTraits
    * This is true if the network is a recurrent neural network.
    */
   static const bool IsRNN = false;
+
+  /**
+   * This is true if the network is a convolutional neural network.
+   */
+  static const bool IsCNN = false;
 };
 
 }; // namespace ann
diff --git a/src/mlpack/methods/ann/rnn.hpp b/src/mlpack/methods/ann/rnn.hpp
index 8efa4d5..102fcc5 100644
--- a/src/mlpack/methods/ann/rnn.hpp
+++ b/src/mlpack/methods/ann/rnn.hpp
@@ -41,10 +41,10 @@ class RNN
 {
   public:
     /**
-     * Construct the RNN object, which will construct a frecurrent neural
+     * Construct the RNN object, which will construct a recurrent neural
      * network with the specified layers.
      *
-     * @param network The network modules used to construct net network.
+     * @param network The network modules used to construct the network.
      * @param outputLayer The outputlayer used to evaluate the network.
      */
     RNN(const ConnectionTypes& network, OutputLayerType& outputLayer) :
@@ -836,6 +836,7 @@ class NetworkTraits<RNN<ConnectionTypes, OutputLayerType, PerformanceFunction> >
  public:
   static const bool IsFNN = false;
   static const bool IsRNN = true;
+  static const bool IsCNN = false;
 };
 
 }; // namespace ann
diff --git a/src/mlpack/methods/ann/trainer/trainer.hpp b/src/mlpack/methods/ann/trainer/trainer.hpp
index 249d3be..cdb948f 100644
--- a/src/mlpack/methods/ann/trainer/trainer.hpp
+++ b/src/mlpack/methods/ann/trainer/trainer.hpp
@@ -231,7 +231,8 @@ class Trainer
     NetworkType& net;
 
     //! The current network error of a single input.
-    typename std::conditional<NetworkTraits<NetworkType>::IsFNN,
+    typename std::conditional<NetworkTraits<NetworkType>::IsFNN ||
+                              NetworkTraits<NetworkType>::IsCNN,
         VecType, MatType>::type error;
 
     //! The current epoch if maxEpochs is set.



More information about the mlpack-git mailing list