Skip to content

Commit

Permalink
Fix custom activation function
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbinBouwmeester committed Aug 25, 2024
1 parent 4685482 commit ea4b5cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions deeplc/deeplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()))
Expand All @@ -615,7 +610,7 @@ def make_preds_core(

ret_preds = []

mod = load_model(mod_name, custom_objects={"<lambda>": lrelu})
mod = load_model(mod_name)
try:
X
ret_preds = mod.predict(
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down

0 comments on commit ea4b5cd

Please sign in to comment.