From ea4b5cd543b391c1238e1c4afdf915772ddf2a66 Mon Sep 17 00:00:00 2001 From: RobbinBouwmeester Date: Sun, 25 Aug 2024 12:12:35 +0200 Subject: [PATCH] Fix custom activation function --- CHANGELOG.md | 7 +++++++ deeplc/deeplc.py | 7 +------ pyproject.toml | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff385b..08394b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.8] - 2024-08-25 + +### Changed + +- Fix custom activation by using default implementation +- Loosen requirements + ## [3.0.7] - 2024-08-19 ### Changed diff --git a/deeplc/deeplc.py b/deeplc/deeplc.py index 9699039..34566f1 100644 --- a/deeplc/deeplc.py +++ b/deeplc/deeplc.py @@ -71,10 +71,6 @@ from deeplc._exceptions import CalibrationError from deeplc.trainl3 import train_en -# "Custom" activation function -lrelu = lambda x: tf.keras.activations.relu(x, alpha=0.1, max_value=20.0) - - # try: # from tensorflow.compat.v1.keras.backend import set_session # noqa: F401 # except ImportError: @@ -597,7 +593,6 @@ def make_preds_core( if len(X) == 0 and len(psm_list) > 0: if self.verbose: logger.debug("Extracting features for the CNN model ...") - # X = self.do_f_extraction_psm_list(psm_list) X = self.do_f_extraction_psm_list_parallel(psm_list) X_sum = np.stack(list(X["matrix_sum"].values())) @@ -615,7 +610,7 @@ def make_preds_core( ret_preds = [] - mod = load_model(mod_name, custom_objects={"": lrelu}) + mod = load_model(mod_name) try: X ret_preds = mod.predict( diff --git a/pyproject.toml b/pyproject.toml index 042958c..437de42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,12 +32,12 @@ keywords = [ dependencies = [ "tensorflow>=2.15.0,<3", - "numpy>=1.17,<2", - "pandas>=0.25,<2", + "numpy>=1.17", + "pandas>=0.25", "h5py>=2.10.0,<4", - "pygam>=0.8.0,<1", + "pygam>=0.8.0", "deeplcretrainer>=1,<2", - "psm_utils>=0.2.3,<1", + "psm_utils>=0.2.3", "hdf5plugin>=4.1.1", "scipy>=1.0.0,<1.14.0" ]