MoFlow is a model for molecule generation that leverages Normalizing Flows. This implementation is an optimized version of the model in the original paper.
To train your model using mixed or TF32 precision with Tensor Cores or using FP32, perform the following steps using the default parameters of the MoFlow model on the ZINC 250k dataset. For the specifics concerning training and inference, refer to the Advanced section.
- Clone the repository.
git clone [https://github.com/NVIDIA/DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples)
cd [DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples)/PyTorch/DrugDiscovery/MoFlow
- Build the MoFlow PyTorch NGC container.
docker build . -t moflow_pyt
- Start an interactive session in the NGC container to run training/inference. Run the following command to launch the Docker container.
docker run --rm -it --shm-size=8gb --gpus all -v <path to results>:/results moflow_pyt
If you want to reuse the dataset between runs, (recommended), use -v :/data to mount your directory inside the container:
docker run --rm -it --shm-size=8gb --gpus all -v <path to results>:/results -v <path to data directory>:/data moflow_pyt
The contents of /data will be downloaded in the following step.
- Download and preprocess the dataset.
bash scripts/prepare_datasets.sh
- Start training and evaluation.
bash scripts/train.sh
- Start inference.
You can train the model yourself (see the prevoius step) or download the pretrained weights from NGC:
wget 'https://api.ngc.nvidia.com/v2/models/nvidia/dle/moflow__pyt_ckpt/versions/22.11.0_amp/files/model_snapshot_epoch_300' -O /results/model_snapshot_epoch_300
Then you can run the inference:
bash scripts/predict.sh
Now that you have your model trained and evaluated, you can choose to compare your training results with our Training accuracy results. You can also choose to benchmark your performance to Training performance benchmark, or Inference performance benchmark. Following the steps in these sections will ensure that you achieve the same accuracy and performance results as stated in the Results section.