In the realm of drug discovery and materials science, the spotlight shines brightly on deep generative models for their impressive capability to learn from extensive datasets and create novel molecular structures. Enter Molecular Sets (MOSES), a benchmarking platform designed for evaluating molecular generation models. Let’s explore how MOSES can elevate your research in this exciting field.
What is MOSES?
MOSES is a pivotal platform for researchers engaged in machine learning applications for drug discovery. It encompasses a diverse array of molecular generation models and a comprehensive set of metrics to gauge the quality and diversity of generated molecules.
With MOSES, researchers can standardize their methodologies and share their innovative models, fostering collaboration and advancement in the field.
Installation: Getting Started with MOSES
Before you can dive into experimenting with molecular generation, you need to install MOSES. Here’s a straightforward installation guide—even if you’re a beginner!
1. Using PyPi
- First, install RDKit by executing the following command:
conda install -yq -c rdkit rdkit
pip install molsets
bash install_latentgan_dependencies.sh
sudo apt-get install libxrender1 libxext6
2. Using Docker
- Install docker and nvidia-docker.
- Pull the existing MOSES image:
docker pull molecularsetsmoses
git clone https://github.com/molecularsetsmoses.git
nvidia-docker image build --tag molecularsetsmoses moses
nvidia-docker run -it --name moses --network=host --shm-size 10G molecularsetsmoses
3. Manual Installation
- Clone the MOSES repository:
git lfs install
git clone https://github.com/molecularsetsmoses.git
Using MOSES to Benchmark Your Models
Once installed, you can effortlessly benchmark your own models using MOSES. Let’s break it down with an analogy.
Understanding Model Benchmarking Through an Analogy
Imagine you own a bakery that specializes in unique cupcakes. You want to find out how well your cupcakes rank against others in the city. MOSES is like a prestigious cupcake competition where bakers showcase their creations, and expert judges (the metrics) evaluate them based on taste, creativity, and overall appearance (quality and diversity).
To participate in this competition, you follow these steps:
- Gather Your Ingredients (Datasets): Import the necessary datasets for training, testing, and evaluating your models using:
python
import moses
train = moses.get_dataset("train")
test = moses.get_dataset("test")
test_scaffolds = moses.get_dataset("test_scaffolds")
from torch.utils.data import DataLoader
from moses import CharVocab, StringDataset
vocab = CharVocab.from_data(train)
train_dataset = StringDataset(vocab, train)
train_dataloader = DataLoader(
train_dataset, batch_size=512,
shuffle=True, collate_fn=train_dataset.default_collate
)
for with_bos, with_eos, lengths in train_dataloader:
...
metrics = moses.get_all_metrics(list_of_generated_smiles)
Troubleshooting Tips
If you encounter any issues during installation or benchmarking, consider the following solutions:
- Ensure all dependencies are correctly installed and compatible with your operating system.
- Check for any additional system requirements or libraries that may need installation.
- Visit the MOSES GitHub Issues page for community assistance and documentation.
- For personalized support, don’t hesitate to connect with other researchers and developers.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

