Skip to content

Commit

Permalink
sync with AZ internal version
Browse files Browse the repository at this point in the history
  • Loading branch information
Löffler, Hannes committed Apr 19, 2024
1 parent ca41ec9 commit 915ec4c
Show file tree
Hide file tree
Showing 57 changed files with 789 additions and 441 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.prior binary
*.prior filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
112 changes: 111 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,120 @@ This follows the guideline on [keep a changelog](https://keepachangelog.com/)
## [Unreleased]

### Changed
- Fragment generators using transformers
- CAZP scoring component


## [4.3.5] 2024-04-18

### Changed

- Code clean-up in create\_adapter()

### Fixed

- Import mol2mol vocabulary rather than copying the file


## [4.3.4] 2024-04-16

### Added

- Write invalid SMILES unchanged to RL CSV


## [4.3.3] 2024-04-16

### Added

- Notebook: demo on how to analyse RL CSV


## [4.3.2] 2024-04-15

### Added

- Dataclass validation for scoring component parameters

### Fixed

- Datatype in MatchingSubstructure's Parameters: only single SMARTS is allowed


## [4.3.1] 2024-04-15

### Added

- Notebook to demo simple RL run, TensorBoard visualisation and TensorBoard data extraction.


## [4.3.0] 2024-04-15

### Added

- Linkinvent based on unified Transformer model supported by RL and sampling. Both beam search and multinomial sampling are implemented.


## [4.2.13] 2024-04-12

### Fixed

- downgraded Chemprop to 1.5.2 and sklearn to 1.2.2 to retain backward compatibility


## [4.2.12] 2024-04-10

### Changed

- New default torch device setup from PyTorch 2.x

### Added

- Config parameter "device" to explicitly set torch device e.g. "cuda:0"


## [4.2.11] 2024-04-08

### Fixed

- Fixed unknown token handling for Mol2mol TL


## [4.2.10] 2024-04-05

### Fixed

- Fixed dataloader for TL to use incomplete batch


## [4.2.9] 2024-04-04

### Fixed

- Skip hash check in metadata if no metadata in model file


## [4.2.8] 2024-04-03

### Added

- Mol2Mol supports unknown tokens for all the priors



## [4.2.7] 2024-03-27

### Added

- Optional randomization in all TL epochs for Reinvent


## [4.2.6] 2024-03-21

### Fixed

- Return from make\_grid\_image()


## [4.2.5] 2024-03-20

### Added
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
New in REINVENT 4.3
===================

For details see CHANGELOG.md.

* Upgrade to **PyTorch 2.2**: rerun `pip install -r requirements-linux-64.lock`
* 2 new **notebooks** demoing Reinvent with reinforcement learning and also transfer learning, includes TensorBoard visualisation and basic analysis
* New Linkinvent model code based on unified transformer
* New PubChem Mol2Mol prior
* Unknown token support for PubChem based transformer models
* New "device" config parameter to allow for explicit device e.g. "cuda:0"
* Optional SMILES randomization in every TL epoch for Reinvent
* Dataclass parameter validation for most scoring components
* Invalid SMILES are now written to the reinforcement learning CSV
* Code improvements and fixes


New in REINVENT 4.2
===================

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Installation
```
4. Optional: if you want to use **AMD GPUs** on Linux you would need to install the [ROCm PyTorch version](https://pytorch.org/get-started/locally/) manually _after_ installation of the dependencies in point 3, e.g.
```shell
pip install torch==1.13.1+rocm5.2 torchvision==0.14.1+rocm5.2 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/rocm5.2
pip install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/rocm5.7
```
5. Install the tool. The dependencies were already installed in the previous step, so there is no need to install them again (flag `--no-deps). If you want to install in editable mode (changes to the code are automatically picked up) add -e before the dot.
```shell
Expand Down Expand Up @@ -90,30 +90,31 @@ appropriate run mode depending on the research problem you are trying to address
There is additional information in `config/toml` in several `*.md` files with
instructions on how to configure the TOML file.
<!--- For concrete examples, you can check out the Jupyter notebook examples in the ReinventCommunity repo.
Running each example will result in a template file.There are templates for many running modes.
Each running mode can be executed by `python input.py some\_running\_mode.json` after activating the environment.
Templates can be manually edited before using. The only thing that needs modification for a standard run are the file
and folder paths. Most running modes produce logs that can be monitored by tensorboard. --->
Tutorials / `Jupyter` notebooks
-------------------------------
NOTE: these will be updated at a later time!
Basic instructions can be found in the comments in the config examples in `config/toml`.
Notebooks will be provided in the `notebook/` directory. Please note that we provide the notebooks in jupytext "light script" format. To work with the light scripts you will need to install jupytext. A few other packages will come in handy too.
```shell
pip install jupytext mols2grid seaborn
```
The Python files in `notebook/` can then be converted to a notebook e.g.
<!--- There is another repository containing useful `jupyter` notebooks related to `REINVENT`
called [ReinventCommunity](https://github.com/MolecularAI/ReinventCommunity). Note, that it uses a
different `conda` environment to execute, so you have to set up a separate environment. --->
```shell
jupytext --to ipynb -o Reinvent_demo.ipynb Reinvent_demo.py
```
Updating dependencies
---------------------
Update the lock files with [pip-tools](https://pypi.org/project/pip-tools/) (please, do not edit the files manually):
```shell
pip-compile --extra-index-url=https://download.pytorch.org/whl/cu113 --extra-index-url=https://pypi.anaconda.org/OpenEye/simple --resolver=backtracking pyproject.toml
pip-compile --extra-index-url=https://download.pytorch.org/whl/cu121 --extra-index-url=https://pypi.anaconda.org/OpenEye/simple --resolver=backtracking pyproject.toml
```
To update a single package, use `pip-compile --upgrade-package somepackage`
(see the documentation for pip-tools).
Expand Down
Loading

0 comments on commit 915ec4c

Please sign in to comment.