PyTorch recently announced the release of its TorchDrug machine learning drug discovery platform to accelerate drug discovery research. The library is open source and can be installed via pip if you have installed PyTorch and torch-scatter using
pip install torchdrug, or through
Register for our Workshop on How To Start Your Career In Data Science?
conda conda install -c milagraph -c conda-forge torchdrug.
TorchDrug covers many recent techniques such as machine learning of graphs, deep generative models and reinforcement learning. It also provides reusable training and assessment routines for common drug discovery tasks including property prediction, pre-trained molecular representations, de novo molecule design, retrosynthesis, and knowledge graph reasoning. biomedical. It is easy to prototype your own data set and application based on these techniques and modules.
For advanced users, the platform provides multiple levels of building blocks for different customization demands. These include low-level data structures and operations (e.g., molecules and graph masking), mid-level layers and modules (e.g., graph convolutions and GNN), and high-level task routines ( for example, prediction of properties). TorchDrug is flexible for all kinds of customization. It also provides graphical data structures and operations for manipulating biomedical objects, as well as reusable layers, models, and tasks for building machine learning models.
TorchDrug’s basic data structures are graphs, which can be used to represent a wide range of biological objects, including molecules, proteins, and biomedical knowledge graphs. The visualization API in the library can be used to check graphic objects.
The PackedGraph data structure, which creates a large unified graph and reindexes each small graph in the batch, can be used to create a batch of graphs of varying size.
Calculation code for a batch of 4 molecules:
mols=data.PackedMolecule.from_smiles(["CCSCCSP(=S)(OC)OC", "CCOC(=O)N", "N(Nc1ccccc1)c2ccccc2", "NC(=O)c1cccnc1"]) mols.visualize() mols = mols.cuda() print(mols) # PackedMolecule(batch_size=4, num_nodes=[12, 6, 14, 9], num_edges=[22, 10, 30, 18], device="cuda:0")
Charts also support a wide variety of indexing operations. Typical uses include applying node masking, edge masking, or chart masking. The optimizer can be used for the task parameters and combine everything in the kernel. The engine provides practical routines for training and testing. To test the model on the validation set, one line is enough.
TorchDrug is designed to meet all kinds of development. It ranges from low-level data structures and operations, to mid-level layers and models, to high-level tasks. Modules can be easily customized to any level with minimal effort by using building blocks of a lower level.
The correspondence between the modules and the hierarchical interface is:
- torchdrug.data: Graph data structures and graph operations; for example molecules.
- torchdrug.datasets: datasets; for example QM9.
- Torchdrug.layers: neural network layers and loss layers; for example the message transmission layer.
- Torchdrug.models: models for learning representation; for example, a neural messaging network.
- torchdrug.tasks: task specific routines; for example the prediction of the properties of molecules.
- Torchdrug.core: Training and evaluation engine.
Machine learning for drug discovery is a rapidly growing field, and the PyTorch team expects TorchDrug to help more and more people get involved in this interdisciplinary field. To learn more about TorchDrug, you can check out Colab tutorials for basic use and multiple drug discovery tasks using the link here.
Subscribe to our newsletter
Receive the latest updates and relevant offers by sharing your email.
Join our Telegram Group. Be part of an engaging community