[mlpack-git] master: Add deterministic parameter to distinguish between trainign and testing. (551f803)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Sun Jul 12 09:23:58 EDT 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/e5905e62c15d1bcff21e6359b11efcd7ab6d7ca0...8b2ca720828224607c70d2b539c43aecf8f4ec32
>---------------------------------------------------------------
commit 551f803fb39804a82927dd42fd569eca2e4e2cbe
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date: Fri Jul 10 21:23:29 2015 +0200
Add deterministic parameter to distinguish between trainign and testing.
>---------------------------------------------------------------
551f803fb39804a82927dd42fd569eca2e4e2cbe
src/mlpack/methods/ann/layer/bias_layer.hpp | 8 ++++++++
src/mlpack/methods/ann/layer/lstm_layer.hpp | 12 ++++++++++--
src/mlpack/methods/ann/layer/neuron_layer.hpp | 9 ++++++++-
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/mlpack/methods/ann/layer/bias_layer.hpp b/src/mlpack/methods/ann/layer/bias_layer.hpp
index 60352a8..0df1f19 100644
--- a/src/mlpack/methods/ann/layer/bias_layer.hpp
+++ b/src/mlpack/methods/ann/layer/bias_layer.hpp
@@ -115,6 +115,11 @@ class BiasLayer
//! Get the number of output maps.
size_t OutputMaps() const { return outputMaps; }
+ //! The the value of the deterministic parameter.
+ bool Deterministic() const {return deterministic; }
+ //! Modify the value of the deterministic parameter.
+ bool& Deterministic() {return deterministic; }
+
private:
//! Locally-stored input activation object.
DataType inputActivations;
@@ -133,6 +138,9 @@ class BiasLayer
//! Locally-stored number of output maps.
size_t outputMaps;
+
+ //! Locally-stored deterministic parameter.
+ bool deterministic;
}; // class BiasLayer
//! Layer traits for the bias layer.
diff --git a/src/mlpack/methods/ann/layer/lstm_layer.hpp b/src/mlpack/methods/ann/layer/lstm_layer.hpp
index 2a4a482..b452ddc 100644
--- a/src/mlpack/methods/ann/layer/lstm_layer.hpp
+++ b/src/mlpack/methods/ann/layer/lstm_layer.hpp
@@ -13,7 +13,7 @@
#include <mlpack/methods/ann/activation_functions/logistic_function.hpp>
#include <mlpack/methods/ann/activation_functions/tanh_function.hpp>
#include <mlpack/methods/ann/init_rules/nguyen_widrow_init.hpp>
-#include <mlpack/methods/ann/optimizer/steepest_descent.hpp>
+#include <mlpack/methods/ann/optimizer/irpropp.hpp>
namespace mlpack {
namespace ann /** Artificial Neural Network. */ {
@@ -37,7 +37,7 @@ template <
class StateActivationFunction = TanhFunction,
class OutputActivationFunction = TanhFunction,
class WeightInitRule = NguyenWidrowInitialization,
- typename OptimizerType = SteepestDescent<>,
+ typename OptimizerType = iRPROPp<>,
typename MatType = arma::mat,
typename VecType = arma::colvec
>
@@ -352,6 +352,11 @@ class LSTMLayer
//! Modify the InGate peephole weights..
MatType& OutGatePeepholeWeights() { return outGatePeepholeWeights; }
+ //! The the value of the deterministic parameter.
+ bool Deterministic() const {return deterministic; }
+ //! Modify the value of the deterministic parameter.
+ bool& Deterministic() {return deterministic; }
+
private:
//! Locally-stored input activation object.
VecType inputActivations;
@@ -442,6 +447,9 @@ class LSTMLayer
//! Locally-stored outgate peephole optimzer object.
std::unique_ptr<OptimizerType> outGatePeepholeOptimizer;
+
+ //! Locally-stored deterministic parameter.
+ bool deterministic;
}; // class LSTMLayer
//! Layer traits for the bias layer.
diff --git a/src/mlpack/methods/ann/layer/neuron_layer.hpp b/src/mlpack/methods/ann/layer/neuron_layer.hpp
index e1abdb7..2f0697e 100644
--- a/src/mlpack/methods/ann/layer/neuron_layer.hpp
+++ b/src/mlpack/methods/ann/layer/neuron_layer.hpp
@@ -40,7 +40,6 @@ template <
typename DataType = arma::colvec
>
class NeuronLayer
-
{
public:
/**
@@ -209,6 +208,11 @@ class NeuronLayer
//! Get the number of output maps.
size_t OutputMaps() const { return outputMaps; }
+ //! The the value of the deterministic parameter.
+ bool Deterministic() const {return deterministic; }
+ //! Modify the value of the deterministic parameter.
+ bool& Deterministic() {return deterministic; }
+
private:
//! Locally-stored input activation object.
DataType inputActivations;
@@ -227,6 +231,9 @@ class NeuronLayer
//! Locally-stored number of output maps.
size_t outputMaps;
+
+ //! Locally-stored deterministic parameter.
+ bool deterministic;
}; // class NeuronLayer
// Convenience typedefs.
More information about the mlpack-git
mailing list