Skip to main content

Providing reproducible modeling

Project description

CARATE

Downloads License: GPL v3 Python Versions Style Black

Bert goes into the karate club

1. Why

Molecular representation is wrecked. Seriously! We chemists talked for decades with an ancient language about something we can't comprehend with that language. We have to stop it, now!

2. What

The success of transformer models is evident. Applied to molecules we need a graph-based transformer. Such models can then learn hidden representations of a molecule better suited to describe a molecule.

For a chemist it is quite intuitive but seldomly modelled as such: A molecule exhibits properties through its combined electronic and structural features

3. Scope

The aim is to implement the algorithm in a reusable way, e.g. for the chembee pattern. Actually, the chembee pattern is mimicked in this project to provide a stand alone tool. The overall structure of the program is reusable for other deep-learning projects and will be transferred to an own project that should work similar to opinionated frameworks.

4. Installation on CPU

Prepare system

sudo apt-get install python3-dev libffi-dev

4.1. Build manually

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu 
pip install torch-scatter torch-sparse torch-geometric rdkit-pypi networkx[default] matplotlib
pip install torch-cluster 
pip install torch-spline-conv 

4.2. Installation from repo

Inside the directory of your git-clone:

pip install -e .

5. Usage

The program is meant to be run as a simple CLI. You can specify the configuration either via a JSON and use the program as a microservice, or you may run it locally from the command line. It is up to you.

Finally, with the new pyproject.toml it is possible to

pip install carate

The installation will install torch with CUDA, so the decision of the library what hardware to use goes JIT (just-in-time). At the moment only CPU/GPU is implemented and FPGA/TPU and others are ignored. Further development of the package will then focus on avoiding special library APIs but make the pattern adaptable to an arbitrary algorithmic/numerical backend.

carate -c path_to_config_file.py

5.1. Start a run

To start a run you need to define the configuration. You can do so by defining a .json or a config.py file

Examples for config.py files are given in config_files

Or you can check the the tutorial.ipynb in notebooks how to use the package with a .json file

5.2. Training results

Most of the training results are saved in a accumulative json on the disk. The reason is to have enough redundancy in case of data failure.

Previous experiments suggest to harden the machine for training to avoid unwanted side-effects as shutdowns, data loss, or data diffusion. You may still send intermediate results through the network, but store the large chunks on the hardened device.

Therefore, any ETL or data processing might not be affected by any interruption on the training machine.

6. Build on the project

Building on the code is not recommended as the project will be continued in another library (building with that would make most sense).

However, you may still use the models as they are by the means of the library production ready.

In case you can't wait for the picky scientist in me, you can still build on my intermediate results. You can find them in the following locations

We have to admit it though: There was a security incident on 31st of March 2023, so the results from Alchemy and ZINC are still waiting. I logged all experiments I did and uploaded the log, such that any picky reviewer can check where there happened weird stuff, I made a mistake, or there was an incident and requests more reproductions. That should solve the issue for now!

7. Support the development

If you are happy about substantial progress in chemistry and life sciences that is not commercial first but citizen first, well then just

Buy Me A Coffee

8. Cite

There is a preprint available on bioRxiv. Read the preprint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carate-0.3.7.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

carate-0.3.7-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

Details for the file carate-0.3.7.tar.gz.

File metadata

  • Download URL: carate-0.3.7.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for carate-0.3.7.tar.gz
Algorithm Hash digest
SHA256 d8a3d6bd2791177b1eb9d14012bdc78a9468d980b6db2855b3c48f29ac674b95
MD5 834e9c7bbb0ad219a8b0d78d403400e4
BLAKE2b-256 3e6cf2ed87f9b4818cc9a2391bec78000cc64b18c1d3e3b848d06234d2624a8f

See more details on using hashes here.

File details

Details for the file carate-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: carate-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for carate-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0cc84e533b8fd0a376d504d5e53e24736f392e2a99276d65e7f773058bad613f
MD5 74af493afd4cc89e8a32c2b2831eaacb
BLAKE2b-256 7c9ba714b726ac04c066a195e4b86ae68a72c07561eef9a04b6aa6d7448375fa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page