[mlpack-git] master: implement serialize (7b85147)

gitdub at mlpack.org gitdub at mlpack.org
Sat Feb 27 02:51:56 EST 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/a2e57d617e952f1ea2fda8a23e1c6bd2f78beb6d...1bedf15126f6bd0bc93a3233914ac95486a3c0da

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

commit 7b85147f59a1cc7a33e87d682ac3a37fa5638e73
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date:   Sat Feb 27 15:51:56 2016 +0800

    implement serialize


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

7b85147f59a1cc7a33e87d682ac3a37fa5638e73
 src/mlpack/methods/ann/layer/linear_layer.hpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mlpack/methods/ann/layer/linear_layer.hpp b/src/mlpack/methods/ann/layer/linear_layer.hpp
index f059bb3..56bb2b7 100644
--- a/src/mlpack/methods/ann/layer/linear_layer.hpp
+++ b/src/mlpack/methods/ann/layer/linear_layer.hpp
@@ -149,6 +149,15 @@ class LinearLayer
   //! Modify the gradient.
   OutputDataType& Gradient() { return gradient; }
   
+  /**
+   * Serialize the layer
+   */
+  template<typename Archive>
+  void Serialize(Archive& ar, const unsigned int /* version */)
+  {    			
+	ar & data::CreateNVP(weights, "weights");
+  }
+
  private:
    /*
    * Calculate the gradient using the output delta (3rd order tensor) and the




More information about the mlpack-git mailing list