ribesstefano commited on
Commit
dafeec2
·
1 Parent(s): 6f31d02

Added save and restore of Optuna studies

Browse files
Files changed (41) hide show
  1. notebooks/protac_degradation_predictor.py +25 -17
  2. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_0_test_split_0.1.pkl +3 -0
  3. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_0_test_split_0.2.pkl +3 -0
  4. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_1_test_split_0.1.pkl +3 -0
  5. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_1_test_split_0.2.pkl +3 -0
  6. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_2_test_split_0.1.pkl +3 -0
  7. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_2_test_split_0.2.pkl +3 -0
  8. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_3_test_split_0.1.pkl +3 -0
  9. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_3_test_split_0.2.pkl +3 -0
  10. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_4_test_split_0.1.pkl +3 -0
  11. reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_4_test_split_0.2.pkl +3 -0
  12. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_0_test_split_0.1.pkl +3 -0
  13. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_0_test_split_0.2.pkl +3 -0
  14. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_1_test_split_0.1.pkl +3 -0
  15. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_1_test_split_0.2.pkl +3 -0
  16. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_2_test_split_0.1.pkl +3 -0
  17. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_2_test_split_0.2.pkl +3 -0
  18. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_3_test_split_0.1.pkl +3 -0
  19. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_3_test_split_0.2.pkl +3 -0
  20. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_4_test_split_0.1.pkl +3 -0
  21. reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_4_test_split_0.2.pkl +3 -0
  22. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_0_test_split_0.1.pkl +3 -0
  23. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_0_test_split_0.2.pkl +3 -0
  24. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_1_test_split_0.1.pkl +3 -0
  25. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_1_test_split_0.2.pkl +3 -0
  26. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_2_test_split_0.1.pkl +3 -0
  27. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_2_test_split_0.2.pkl +3 -0
  28. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_3_test_split_0.1.pkl +3 -0
  29. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_3_test_split_0.2.pkl +3 -0
  30. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_4_test_split_0.1.pkl +3 -0
  31. reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_4_test_split_0.2.pkl +3 -0
  32. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_0_test_split_0.1.pkl +3 -0
  33. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_0_test_split_0.2.pkl +3 -0
  34. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_1_test_split_0.1.pkl +3 -0
  35. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_1_test_split_0.2.pkl +3 -0
  36. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_2_test_split_0.1.pkl +3 -0
  37. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_2_test_split_0.2.pkl +3 -0
  38. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_3_test_split_0.1.pkl +3 -0
  39. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_3_test_split_0.2.pkl +3 -0
  40. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_4_test_split_0.1.pkl +3 -0
  41. reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_4_test_split_0.2.pkl +3 -0
notebooks/protac_degradation_predictor.py CHANGED
@@ -783,24 +783,32 @@ def hyperparameter_tuning_and_training(
783
  # Create an Optuna study object
784
  sampler = TPESampler(seed=42, multivariate=True)
785
  study = optuna.create_study(direction='minimize', sampler=sampler)
786
- study.optimize(
787
- lambda trial: objective(
788
- trial,
789
- train_df,
790
- val_df,
791
- hidden_dim_options=hidden_dim_options,
792
- batch_size_options=batch_size_options,
793
- learning_rate_options=learning_rate_options,
794
- smote_k_neighbors_options=smote_k_neighbors_options,
795
- fast_dev_run=fast_dev_run,
796
- active_label=active_label,
797
- disabled_embeddings=disabled_embeddings,
798
- ),
799
- n_trials=n_trials,
800
- )
801
 
 
802
  if study_filename:
803
- joblib.dump(study, study_filename)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
804
 
805
  # Retrain the model with the best hyperparameters
806
  model, trainer, metrics = train_model(
@@ -1030,7 +1038,7 @@ def main(
1030
  del trainer
1031
 
1032
  # Ablation study: disable embeddings at a time
1033
- for disabled_embeddings in [['poi'], ['cell'], ['smiles'], ['e3', 'cell'], ['poi', 'e3', 'cell']]:
1034
  print('-' * 100)
1035
  print(f'Ablation study with disabled embeddings: {disabled_embeddings}')
1036
  print('-' * 100)
 
783
  # Create an Optuna study object
784
  sampler = TPESampler(seed=42, multivariate=True)
785
  study = optuna.create_study(direction='minimize', sampler=sampler)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
786
 
787
+ study_loaded = False
788
  if study_filename:
789
+ if os.path.exists(study_filename):
790
+ study = joblib.load(study_filename)
791
+ study_loaded = True
792
+ print(f'Loaded study from {study_filename}')
793
+
794
+ if not study_loaded:
795
+ study.optimize(
796
+ lambda trial: objective(
797
+ trial,
798
+ train_df,
799
+ val_df,
800
+ hidden_dim_options=hidden_dim_options,
801
+ batch_size_options=batch_size_options,
802
+ learning_rate_options=learning_rate_options,
803
+ smote_k_neighbors_options=smote_k_neighbors_options,
804
+ fast_dev_run=fast_dev_run,
805
+ active_label=active_label,
806
+ disabled_embeddings=disabled_embeddings,
807
+ ),
808
+ n_trials=n_trials,
809
+ )
810
+ if study_filename:
811
+ joblib.dump(study, study_filename)
812
 
813
  # Retrain the model with the best hyperparameters
814
  model, trainer, metrics = train_model(
 
1038
  del trainer
1039
 
1040
  # Ablation study: disable embeddings at a time
1041
+ for disabled_embeddings in [['e3'], ['poi'], ['cell'], ['smiles'], ['e3', 'cell'], ['poi', 'e3', 'cell']]:
1042
  print('-' * 100)
1043
  print(f'Ablation study with disabled embeddings: {disabled_embeddings}')
1044
  print('-' * 100)
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_0_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:258ead80bfa66c98f250374143a4587f4b8e51d6449bbeb54100ae06e3ab1b91
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_0_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5329684c4b6e305284aadbec651c0ad44fcee795f0a09c15b1c395150596ea1f
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_1_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e6a65a3dfed7f5281a55f97619e94b44e7a4ecc0ed20d97c150ce583dcdd220
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_1_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6366b23ad7b3f37c135efe546e9c2fa81a697a6abac605116d7b3178265c8c46
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_2_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0d245147130f8303d37e9995b35db618c480f8679b97e12c4d069f90b3b806c
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_2_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41abf93de0f3d7c3766c4df0b5ad9a95b0f84ad7acb145ab416d9058dbcb3972
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_3_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf374269d482f85afadd83b0bbf3bb8cc4d600d07711779c9edf94676f0d32fc
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_3_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a0386512fb6a9aae07562a8ab6f1a87471969153105461ebd509420a1f59b66
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_4_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d9b5b42bdb3140bbfc45e94022e92464b87f328789e490e64ea9dacb6905100
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_e3_ligase_fold_4_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42bda2152c32dd94070c523ff5dfb976a422038cda44bf32fcb941c897aec467
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_0_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0fc7210ba0e68361426dea9f6663e20c23997e88146436dc8a26948c18b97e1f
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_0_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e490b0ed7440b8ea51ff265d8a68a1b0f3d1cea260461eb47dbeac92430c42bb
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_1_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb5fb7244b181e7fe1754570bc8878d413e3c03957e497be3e82042bca49c181
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_1_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53792a857d41cf5f2f19c17a000fddc9709990c831ae5d99380a4dc1c44f70be
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_2_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea9e6e8e475ef6d0a37b534086aea24ce2e7d7ca7fd7146472d09066d19f3888
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_2_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f137f1f60be4f7ab3f88c945fc4cb42e0c65750d70c4cf75cfe93881f2f0c1d9
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_3_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab8b97e70915fb864e26c086833306d40fe4e64bd4d46fc95fc67551eac31d51
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_3_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a51f48587376a0e60b62633193c301a45e14e27409f9453f1c33088863a158d7
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_4_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95cf6ff3653506b6118c14a4738c1bc5c87969309ae7052fb794fdecf1a59550
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_random_fold_4_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73a4684a20c4ab2a7cbe7fac42b6c48d154a7643031da38d35ca0e2dbce98e82
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_0_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27aa74ab92272f4c455f8eb32e7da3d3b71e213937f9a96a7d07e3ca61af06fb
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_0_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:647f8b8e72f9f1f72ecdb8733b306df290f62fee42d30ab6da0f26cf3ed3b010
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_1_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8b8cd9536d7d1fab755506dc6cddf5d0d66ae3743f3a687dc5e82d44b134cd7
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_1_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:375e5f4f5080d2cf654b932faedeb2b0e9433d0c738542098f789beecd980c65
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_2_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2503fafc20807b89d6663a978a1a52d923cd36a43e09b2cd5761bfd42c505942
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_2_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7298a04d0888f4de87041efd6b78c42e13c3f1630c43567d582bc7710a40847
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_3_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac2296caf215b91d3afbf2f31a625cdade8a1557f791e43350fe86e04373c6f7
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_3_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2a7a9f6ed11e1b5b6f876dd927612d03f4780f9db3e65b9f1ebb8fbd853677f
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_4_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:994f1b499f359d0fb32eb708054826edecd317862cff181455fae8040330f6b9
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_tanimoto_fold_4_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd4c40033da16a1cee16fd998c82e0403a31db4d14ba0604160ea143bae03668
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_0_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24bd2673efb0d3855509d2cd33f08f2d455994a63663300225753bc87f8067c1
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_0_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d6f639ff3a4d6c1b73388bf02f2bfaea087a5dd8eb5ce60080276039cbf08ad
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_1_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:613e1eb1538067c795baf80a6ec8fc3fd81f952b34cf119a9b21ba0e0fa0db73
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_1_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85569ae5c9c134baa736d5235e7b62466e92abc364c8ba95d8c995f06a589486
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_2_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20ab1d27b21e5afda52c2a13ba152e1b5a3b9ad471b5e453ed48809be6721271
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_2_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63a3b9252d05935811200a76ae7de1bcc3e90ff058082f77cd5dfc082e697187
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_3_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba80e55724bab9860cd417bd6a6b9047a40a572a7e2ffc8e3d52af8e61036a7f
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_3_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e71cf47ccba99e2571a0d761016c7374cb894914a9fdb0aa68b8bdac98801d93
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_4_test_split_0.1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e2f1a70f7a8ec861d039db65f3ba91458d08fdda3887c2a6ecb9e91bbb4f514
3
+ size 45164
reports/study_Active_Dmax_0.6_pDC50_6.0_uniprot_fold_4_test_split_0.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79ead33aaa6246c3125a27ca452703b798d0f89df0887e9cad1e1c8907ff2fbd
3
+ size 45164