-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3caabca
commit 7ba0748
Showing
3 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import pickle as pkl | ||
import design_bench as db | ||
import numpy as np | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
with open("type_assay_pairs.pkl", "wb") as f: | ||
type_assay_pairs = pkl.load(f) | ||
|
||
all_rank_corr = [] | ||
|
||
for type_name, assay_name in type_assay_pairs: | ||
|
||
task = db.make( | ||
'ChEMBLMorganFingerprint-FullyConnected-v0', | ||
|
||
dataset_kwargs=dict( | ||
max_samples=None, | ||
distribution=None, | ||
max_percentile=50, | ||
min_percentile=0, | ||
assay_chembl_id=assay_name, | ||
standard_type=type_name), | ||
|
||
oracle_kwargs=dict( | ||
noise_std=0.0, | ||
max_samples=None, | ||
distribution=None, | ||
max_percentile=100, | ||
min_percentile=0, | ||
|
||
feature_extractor=MorganFingerprintFeatures(dtype=np.float32), | ||
|
||
model_kwargs=dict( | ||
hidden_size=512, | ||
activation='relu', | ||
num_layers=2, | ||
epochs=5, | ||
shuffle_buffer=5000, | ||
learning_rate=0.0001), | ||
|
||
split_kwargs=dict( | ||
val_fraction=0.1, | ||
subset=None, | ||
shard_size=50000, | ||
to_disk=True, | ||
disk_target=f"chembl-{type_name}-{assay_name}/split", | ||
is_absolute=False)) | ||
|
||
) | ||
|
||
print(type_name, assay_name, | ||
task.oracle.params['rank_correlation']) | ||
|
||
all_rank_corr.append(task.oracle.params['rank_correlation']) | ||
|
||
best_type_name, best_assay_name = \ | ||
type_assay_pairs[np.argmax(np.array(all_rank_corr))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters