-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from leynier/megexplainer-migration
meg explainer migration
- Loading branch information
Showing
19 changed files
with
1,103 additions
and
621 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"experiment": { | ||
"scope": "meg_Test", | ||
"parameters": { | ||
"lock_release_tout": 120, | ||
"propagate": [] | ||
} | ||
}, | ||
"do-pairs": [ | ||
{ | ||
"dataset": { | ||
"class": "src.dataset.dataset_base.Dataset", | ||
"parameters": { | ||
"generator": { | ||
"class": "src.dataset.generators.bbbp.BBBP", | ||
"parameters": { | ||
"data_dir": "data/datasets/bbbp/", | ||
"data_file_name": "BBBP-reduced.csv", | ||
"data_label_name": "p_np" | ||
} | ||
}, | ||
"n_splits": 2 | ||
} | ||
}, | ||
"oracle": { | ||
"class": "src.oracle.nn.torch.OracleTorch", | ||
"parameters": { | ||
"epochs": 50, | ||
"batch_size": 2, | ||
"optimizer": { | ||
"class": "torch.optim.RMSprop", | ||
"parameters": { | ||
"lr": 0.001, | ||
"momentum": 0.5 | ||
} | ||
}, | ||
"loss_fn": { | ||
"class": "torch.nn.CrossEntropyLoss", | ||
"parameters": { | ||
"reduction": "mean" | ||
} | ||
}, | ||
"model": { | ||
"class": "src.oracle.nn.gcn.DownstreamGCN", | ||
"parameters": { | ||
"num_conv_layers": 2, | ||
"num_dense_layers": 1, | ||
"conv_booster": 2, | ||
"linear_decay": 1.8 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"explainers": [ | ||
{ | ||
"class": "src.explainer.rl.meg.MEGExplainer", | ||
"parameters": { | ||
"num_input": 1024, | ||
"env": { | ||
"class": "src.explainer.rl.meg_utils.environments.bbbp_env.BBBPEnvironment", | ||
"parameters": {} | ||
}, | ||
"action_encoder": { | ||
"class": "src.explainer.rl.meg_utils.utils.encoders.MorganCountFingerprintActionEncoder", | ||
"parameters": {} | ||
} | ||
} | ||
}, | ||
{ | ||
"class": "src.explainer.search.dces.DCESExplainer", | ||
"parameters": {} | ||
} | ||
], | ||
"compose_mes": "config/snippets/default_metrics.json", | ||
"compose_strs": "config/snippets/default_store_paths.json" | ||
} |
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,5 @@ | ||
num,name,p_np,smiles | ||
1,Propanolol,1,[Cl].CC(C)NCC(O)COc1cccc2ccccc12 | ||
2,Terbutylchlorambucil,1,C(=O)(OC(C)(C)C)CCCc1ccc(cc1)N(CCCl)CCCl | ||
3,SKF-93619,0,c1cc2c(cc(CC3=CNC(=NC3=O)NCCSCc3oc(cc3)CN(C)C)cc2)cc1 | ||
4,M2L-663581,0,OCC(C)(O)c1onc(c2ncn3c2CN(C)C(c4c3cccc4Cl)=O)n1 |
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
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
from typing import Optional | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from src.dataset.dataset_base import Dataset | ||
|
||
|
||
class DataInstance: | ||
|
||
def __init__(self, id, label, data, dataset=None): | ||
def __init__(self, id, label, data, dataset: Optional["Dataset"] = None): | ||
self.id = id | ||
self.data = data | ||
self.label = label #TODO: Refactoring to have a one-hot encoding of labels! | ||
self.label = label # TODO: Refactoring to have a one-hot encoding of labels! | ||
self._dataset = dataset | ||
|
||
|
||
|
||
|
||
|
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
Oops, something went wrong.