diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c7c8d..0d7d27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ # Changelog +## [0.1.2](https://github.com/brsynth/amn_library/tree/0.1.2) (2026-03-31) + +[Full Changelog](https://github.com/brsynth/amn_library/compare/0.1.1...0.1.2) + +## [0.1.1](https://github.com/brsynth/amn_library/tree/0.1.1) (2026-03-30) + +[Full Changelog](https://github.com/brsynth/amn_library/compare/0.1.0...0.1.1) + +**Merged pull requests:** + +- v0.1.1 [\#2](https://github.com/brsynth/amn_library/pull/2) ([ramez17khaled](https://github.com/ramez17khaled)) + +## [0.1.0](https://github.com/brsynth/amn_library/tree/0.1.0) (2026-03-30) + +[Full Changelog](https://github.com/brsynth/amn_library/compare/df1d126ffc9bc50ceed7a9fc4d66d1fa7e41490f...0.1.0) + +**Merged pull requests:** + +- init amn [\#1](https://github.com/brsynth/amn_library/pull/1) ([ramez17khaled](https://github.com/ramez17khaled)) + + + \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/amn/Build_Model.py b/amn/Build_Model.py index 766e155..20f3c9a 100644 --- a/amn/Build_Model.py +++ b/amn/Build_Model.py @@ -19,8 +19,8 @@ def sharp_sigmoid(x): # Custom activation function return K.sigmoid(10000.0 * x) -from tensorflow.keras.utils import get_custom_objects, CustomObjectScope -from tensorflow.keras.layers import Activation, Lambda +from keras.utils import get_custom_objects, CustomObjectScope +from keras.layers import Activation, Lambda get_custom_objects().update({'sharp_sigmoid': Activation(sharp_sigmoid)}) def my_mse(y_true, y_pred): @@ -55,7 +55,7 @@ def CROP(dimension, start, end): # Crops (or slices) a Tensor on a given dimension from start to end # example : to crop tensor x[:, :, 5:10] # call x = crop(2,5,10)(x) to slice the second dimension - from tensorflow.keras.layers import Lambda + from keras.layers import Lambda def func(x): if dimension == 0: return x[start: end] @@ -165,9 +165,9 @@ def Loss_all(V, Vinko, Vout, parameter): # Dense model # ############################################################################## -from tensorflow.keras.layers import Input, Dense, Dropout, Flatten, Activation, BatchNormalization -from tensorflow.keras.layers import Reshape, multiply -from tensorflow.keras.layers import concatenate, add, subtract, dot +from keras.layers import Input, Dense, Dropout, Flatten, Activation, BatchNormalization +from keras.layers import Reshape, multiply +from keras.layers import concatenate, add, subtract, dot def input_ANN_Dense(parameter, verbose=False): # Shape X and Y depending on the model used @@ -180,7 +180,7 @@ def input_ANN_Dense(parameter, verbose=False): def Dense_layers(inputs, parameter, trainable=True, verbose=False): # Build a dense architecture with some hidden layers - from tensorflow.keras.regularizers import l2 + from keras.regularizers import l2 activation=parameter.activation n_hidden=parameter.n_hidden @@ -614,9 +614,9 @@ def train_evaluate_model(parameter, failure=0, temperature=0, verbose=False): # ############################################################################## from amn.Build_Dataset import TrainingSet -from tensorflow.keras.models import load_model -from tensorflow.keras.models import Model -from tensorflow.keras.models import model_from_json +from keras.models import load_model +from keras.models import Model +from keras.models import model_from_json from sklearn.metrics import r2_score from sklearn.metrics import accuracy_score, f1_score, matthews_corrcoef @@ -760,7 +760,7 @@ def save(self, filename, verbose=False): h.write(s) self.model.save(filemodel) - def load(self, filename, fileparam, filemodel, output_dim=-1, verbose=False): + def load(self, filename, fileparam=None, filemodel=None, output_dim=-1, verbose=False): if filename == "" or filename is None: fileparam = fileparam filemodel = filemodel diff --git a/amn/_version.py b/amn/_version.py index 3dc1f76..ae73625 100644 --- a/amn/_version.py +++ b/amn/_version.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.3" diff --git a/environment.yaml b/environment.yaml index 8a765d8..147d74a 100644 --- a/environment.yaml +++ b/environment.yaml @@ -1,10 +1,10 @@ -name: reservoir +name: test_reservoir channels: - defaults - conda-forge dependencies: - - python =3.8 + - python =3.11 - numpy =1.23.5 - pandas - matplotlib @@ -16,6 +16,6 @@ dependencies: - typing_extensions =4.5.0 - pip - ipykernel - - tensorflow =2.4.1 + - tensorflow =2.12.1 - tensorflow-probability - importlib-resources \ No newline at end of file diff --git a/setup.py b/setup.py index 393478c..f1bd93d 100644 --- a/setup.py +++ b/setup.py @@ -55,5 +55,5 @@ def get_version(): 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', ], - python_requires = '>=3.8', + python_requires = '>=3.11', ) \ No newline at end of file diff --git a/tests/data/IJN1463EXP_AMN_QP_model.h5 b/tests/data/IJN1463EXP_AMN_QP_model.h5 index 5ca3f42..edc5409 100644 Binary files a/tests/data/IJN1463EXP_AMN_QP_model.h5 and b/tests/data/IJN1463EXP_AMN_QP_model.h5 differ diff --git a/tests/data/IJN1463EXP_AMN_QP_param.csv b/tests/data/IJN1463EXP_AMN_QP_param.csv index 2ee8468..b1357a2 100644 --- a/tests/data/IJN1463EXP_AMN_QP_param.csv +++ b/tests/data/IJN1463EXP_AMN_QP_param.csv @@ -1 +1 @@ -./Dataset_input/Putida/IJN1463EXP,AMN_QP,3,['BIOMASS_KT2440_WT3'],1,174,4038,1,500,sigmoid,500,accuracy_score,0.001,0.25,10,0,5 \ No newline at end of file +/home/rkhaled/amn_library/amn/models/IJN1463EXP,AMN_QP,3,['BIOMASS_KT2440_WT3'],1,174,4038,1,500,relu,500,r2_score,0.001,0.25,10,0,5 \ No newline at end of file