Skip to content

Commit

Permalink
hotfix for fingerprint calculation (when SMILES is invalid)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandontrabucco committed Sep 1, 2021
1 parent 7ba0748 commit 9fb04fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ The goal of model-based optimization is to find an input **x** that maximizes an
Design-Bench can be installed with the complete set of benchmarks via our pip package.

```bash
pip install design-bench[all]==2.0.15
pip install design-bench[all]==2.0.16
pip install morphing-agents==1.5.1
```

Alternatively, if you do not have MuJoCo, you may opt for a minimal install.

```bash
pip install design-bench==2.0.15
pip install design-bench==2.0.16
```

## Available Tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ def dataset_to_oracle_x(self, x_batch, dataset):
tokens = xi[1:stop_tokens[0] if stop_tokens.size > 0 else xi[1:]]

# apply morgan fingerprint featurization using rdkit
value = self.featurizer.featurize(
self.tokenizer.decode(tokens).replace(" ", ""))[0]
token_string = self.tokenizer.decode(tokens).replace(" ", "")
value = self.featurizer.featurize(token_string)[0]

# collate all results into a single numpy array
x_out.append(np.zeros([2048], dtype=self.dtype)
if value is None
x_out.append(np.zeros([self.size], dtype=self.dtype)
if value.size != self.size
else np.array(value, dtype=self.dtype))

return np.asarray(x_out)
Expand Down
3 changes: 2 additions & 1 deletion example_iteration_script.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import pickle as pkl
import design_bench as db
import numpy as np
from design_bench.oracles.feature_extractors.morgan_fingerprint_features import MorganFingerprintFeatures


if __name__ == "__main__":

with open("type_assay_pairs.pkl", "wb") as f:
with open("type_assay_pairs.pkl", "rb") as f:
type_assay_pairs = pkl.load(f)

all_rank_corr = []
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
LONG_DESCRIPTION = readme.read()


setup(name='design-bench', version='2.0.15', license='MIT',
setup(name='design-bench', version='2.0.16', license='MIT',
packages=find_packages(include=['design_bench', 'design_bench.*']),
description='Design-Bench: Benchmarks for '
'Data-Driven Offline Model-Based Optimization',
Expand All @@ -17,7 +17,7 @@
author_email='brandon@btrabucco.com',
url='https://github.com/brandontrabucco/design-bench',
download_url='https://github.com/'
'brandontrabucco/design-bench/archive/v2_0_15.tar.gz',
'brandontrabucco/design-bench/archive/v2_0_16.tar.gz',
keywords=['Deep Learning', 'Neural Networks',
'Benchmark', 'Model-Based Optimization'],
extras_require={'all': ['gym[mujoco]'], 'cma': ['cma']},
Expand Down

0 comments on commit 9fb04fc

Please sign in to comment.