Preprint: Predicting Three-Component Reaction Outcomes from 40k Miniaturized Reactant Combinations
For code used to collect experimental data, see this repository.
conda env create -f environment.yaml
or (if you don't have a suitable GPU):
conda env create -f environment_cpuonly.yaml
Notes:
- The
environment.yaml
file is written for a workstation with Nvidia GPU. Useenvironment_cpuonly.yaml
instead to run only on CPU. This will not installCUDA
and will install the CPU-only versions ofpytorch
anddgl
. - Installing the
dgl
dependency throughconda
sometimes creates issues where some packages are "not found" despite existing in the specified channels. Instead, try installingdgl
separately withpip
:pip install dgl -f https://data.dgl.ai/wheels/repo.html
- On some systems with outdated libraries (such as university clusters)
dgl
wheels may not work, and you may need to build it from source. See the DGL installation guide for more information. - There is an issue with
pytorch
and the2024.1.x
version of themkl
dependency. If anImportError [...] undefined symbol: iJIT_NotifyEvent
occurs, downgrade withconda install mkl=2024.0
We track training runs with WandB.
Before starting any training runs, you need to log into WandB
by running
wandb login
then supply your API key.
The run.py
script serves as an entrypoint for training models.
It is configured with a set of command line arguments,
including the path to a configuration file with model hyperparameters.
See config/config_example.yaml
for an example configuration file.
To see the full list of command line arguments, run:
python run.py train --help
The inference.py
script serves as an entrypoint for predicting reaction outcome.
It expects a CSV file with three columns: initiator
, monomer
, terminator
.
See config/config_example.yaml
for an example configuration file.
Call it like:
python inference.py -i example_reactants.csv -o out.csv
or use python inference.py --help
for more information.
We use nbstripout to remove output from notebooks before committing to the repository. Install with:
conda install -c conda-forge nbstripout # or pip install nbstripout
nbstripout --install # configures git filters and attributes for this repo
We use pre-commit hooks to ensure standardized code formatting. Install with:
pre-commit install