-
Notifications
You must be signed in to change notification settings - Fork 54
Enhanced StructGen ANN functionality #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
added ANN support
fixed keras versioning causing issues with loading ANN
fixed keras versioning, made it safer, accepts more errors with ease and grace
Updated to better handle keras 3 and safer
added enhanced structgen ANN functionality
| new_true = np.where((~prev) & curr)[0] + 1 # +1 for 1-based indexing | ||
| batslist.append(list(new_true)) | ||
| # Update stored state | ||
| prev = curr.copy() |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning
redefined
| """ | ||
| # initialize ANN | ||
| globs = globalvars() |
Check notice
Code scanning / CodeQL
Unused local variable Note
| [f"{float(i):.2f}" for i in r_ls[0]]) + ' angstrom') | ||
| print('ANN high spin bond length (ax1/ax2/eq) is predicted to be: ' + " /".join( | ||
| [f"{float(i):.2f}" for i in r_hs[0]]) + ' angstrom') | ||
| except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
| # fix OB bug: https://github.com/openbabel/openbabel/issues/1983 | ||
| import sys | ||
| import os | ||
| import numpy as np |
Check notice
Code scanning / CodeQL
Unused import Note
| parseCLI) | ||
| from molSimplify.Scripts.generator import startgen | ||
| from molSimplify.Classes.globalvars import globalvars | ||
| from molSimplify.Classes.globalvars import globalvars, geometry_vectors |
Check notice
Code scanning / CodeQL
Unused import Note
| mod_name = "sklearn.grid_search" | ||
| if mod_name not in sys.modules: | ||
| sys.modules[mod_name] = _ms | ||
| except Exception: |
Check notice
Code scanning / CodeQL
Empty except Note
| mod_name = "sklearn.cross_validation" | ||
| if mod_name not in sys.modules: | ||
| sys.modules[mod_name] = _ms2 | ||
| except Exception: |
Check notice
Code scanning / CodeQL
Empty except Note
| try: | ||
| loaded_model = load_keras_ann(predictor) | ||
| result = data_rescale(loaded_model.predict(excitation, verbose=0), train_mean_y, train_var_y, debug=debug) | ||
| except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
| loaded_model = load_keras_ann(predictor) | ||
| try: | ||
| loaded_model = load_keras_ann(predictor) | ||
| except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
| try: | ||
| latent_train_row = get_layer_outputs(loaded_model, len(loaded_model.layers) - 2, | ||
| [np.array([scaled_row])], training_flag=False) | ||
| except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
| try: | ||
| from keras.saving.legacy.model_config import model_from_json as _legacy_model_from_json | ||
| except Exception: | ||
| _legacy_model_from_json = None |
Check notice
Code scanning / CodeQL
Unused local variable Note
| except Exception: | ||
| _legacy_model_from_json = None | ||
| except Exception: | ||
| _legacy_model_from_json = None |
Check notice
Code scanning / CodeQL
Unused local variable Note
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #482 +/- ##
==========================================
- Coverage 40.12% 39.75% -0.37%
==========================================
Files 93 93
Lines 29560 29886 +326
==========================================
+ Hits 11861 11882 +21
- Misses 17699 18004 +305
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added a number of things to ensure safe building with the --ANN flag