From 45f6e1abee60f0bb14c84b455ffe47a903c3c806 Mon Sep 17 00:00:00 2001 From: Haonan Date: Thu, 10 Nov 2016 16:29:23 -0800 Subject: [PATCH] change hlactivetype instead of act.name --- paddle/utils/Util.cpp | 2 +- python/paddle/trainer_config_helpers/activations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/utils/Util.cpp b/paddle/utils/Util.cpp index 2cdff9d1ac..b16d431465 100644 --- a/paddle/utils/Util.cpp +++ b/paddle/utils/Util.cpp @@ -378,7 +378,7 @@ hl_activation_mode_t hlActiveType(const std::string& type) { return HL_ACTIVATION_RELU; } else if (type == "tanh") { return HL_ACTIVATION_TANH; - } else if (type == "linear") { + } else if (type == "linear" || type == "") { return HL_ACTIVATION_LINEAR; } else { LOG(FATAL) << "Do not support activation type " << type; diff --git a/python/paddle/trainer_config_helpers/activations.py b/python/paddle/trainer_config_helpers/activations.py index 29b5437446..2202d0bf96 100644 --- a/python/paddle/trainer_config_helpers/activations.py +++ b/python/paddle/trainer_config_helpers/activations.py @@ -104,7 +104,7 @@ class IdentityActivation(BaseActivation): Just do nothing for output both forward/backward. """ - def __init__(self): BaseActivation.__init__(self, 'linear', False) + def __init__(self): BaseActivation.__init__(self, '', False) LinearActivation = IdentityActivation -- GitLab