From 17e37aa85b22b615155cd0938123ad4a451a93b9 Mon Sep 17 00:00:00 2001 From: leufen1 <l.leufen@fz-juelich.de> Date: Tue, 9 Mar 2021 19:16:05 +0100 Subject: [PATCH] catch if regularizer is None but as string --- mlair/model_modules/fully_connected_networks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlair/model_modules/fully_connected_networks.py b/mlair/model_modules/fully_connected_networks.py index 948d2b06..1f965f3c 100644 --- a/mlair/model_modules/fully_connected_networks.py +++ b/mlair/model_modules/fully_connected_networks.py @@ -120,8 +120,8 @@ class FCN(AbstractModelClass): raise AttributeError(f"Given optimizer {optimizer} is not supported in this model class.") def _set_regularizer(self, regularizer, **kwargs): - if regularizer is None: - return regularizer + if regularizer is None or (isinstance(regularizer, str) and regularizer.lower() == "none"): + return None try: reg_name = regularizer.lower() reg = self._regularizer.get(reg_name) -- GitLab