diff options
author | Rico Sennrich <rico.sennrich@gmx.ch> | 2015-09-03 20:14:46 +0300 |
---|---|---|
committer | Rico Sennrich <rico.sennrich@gmx.ch> | 2015-09-03 20:14:46 +0300 |
commit | c62011449d80633a505588392c5fbf01fc79d7f8 (patch) | |
tree | dd57d2ae9024e94325570a9dd7f6567783db62ef | |
parent | 12fd985180a7c9a7aee402c2f05a1f9651566de3 (diff) |
-rw-r--r-- | src/Activation_function.h | 2 | ||||
-rw-r--r-- | src/neuralClasses.h | 2 | ||||
-rw-r--r-- | src/param.h | 2 | ||||
-rw-r--r-- | src/util.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/Activation_function.h b/src/Activation_function.h index 2eec74d..b85aec6 100644 --- a/src/Activation_function.h +++ b/src/Activation_function.h @@ -59,7 +59,7 @@ struct dtanh_functor { }; struct rectifier_functor { - user_data_t operator() (user_data_t x) const { return std::max(x, 0.); } + user_data_t operator() (user_data_t x) const { return std::max(x, user_data_t(0.)); } }; struct drectifier_functor { diff --git a/src/neuralClasses.h b/src/neuralClasses.h index 182db0d..d337151 100644 --- a/src/neuralClasses.h +++ b/src/neuralClasses.h @@ -35,7 +35,7 @@ typedef boost::unordered_map<int,bool> int_map; struct Clipper{ user_data_t operator() (user_data_t x) const { - return std::min(0.5, std::max(x,-0.5)); + return std::min(user_data_t(0.5), std::max(x,user_data_t(-0.5))); //return(x); } }; diff --git a/src/param.h b/src/param.h index e0f8437..8f1aad2 100644 --- a/src/param.h +++ b/src/param.h @@ -3,7 +3,7 @@ #include <string> -#ifdef NPLM_DOUBLE_PRECISION +#if NPLM_DOUBLE_PRECISION == 1 typedef double user_data_t; #else typedef float user_data_t; @@ -20,7 +20,7 @@ #include "maybe_omp.h" -#ifdef NPLM_DOUBLE_PRECISION +#if NPLM_DOUBLE_PRECISION == 1 typedef double user_data_t; #else typedef float user_data_t; |