How uta-smile/smiles-bert works
SMILES-BERT is a molecular-sequence learning application built on an older fairseq toolkit. Its documented core workflow converts raw SMILES to indexed data, pre-trains a BERT model, then fine-tunes it on labeled molecular properties. The repository also contains SMILES generation and prediction task modules and inference entry points. The graph distinguishes those product stages from fairseq’s shared model, training, and data layers; unsampled module wiring is omitted where it cannot be established.
Main entry points: trainer.py Training engine · train.py Training entry · indexed_dataset.py Indexed datasets · bert.py BERT pretraining
Components 21
SMILES preparation
- Binarize data
binarize_smiles.py - Preprocess data
preprocess.py - Indexed datasets
fairseq/data/indexed_dataset.py - SMILES datasets
fairseq/data/smile_prediction_dataset.py
Model learning
- BERT pretraining
fairseq/tasks/bert.py - Property fine-tuning
fairseq/tasks/smile_property_prediction.py - Molecular models
fairseq/models/bert.py - Learning objectives
fairseq/criterions/seq3seq.py
Inference and evaluation
- SMILES generation
fairseq/tasks/smile_generation.py - Sequence generation
fairseq/sequence_generator.py - Generate molecules
generate.py - Interactive inference
interactive.py - Model evaluation
eval.py - Language-model evaluation
eval_lm.py - Property prediction
fairseq/tasks/smile_property_prediction.py
Fairseq runtime
- Training engine
fairseq/trainer.py - Optimizers
fairseq/optim/adam.py - Training entry
train.py
Other components
- Model user
- Raw SMILES
- Labeled SMILES
Connections 23
- Model user → Raw SMILES: provides
- Raw SMILES → Binarize data: encodes
- Binarize data → Indexed datasets: writes
- Labeled SMILES → Preprocess data: provides
- Preprocess data → Indexed datasets: prepares
- Indexed datasets → SMILES datasets: loads
- Training entry → BERT pretraining: sets up
- Training entry → Property fine-tuning: sets up
- Training entry → Training engine: trains with
- BERT pretraining → SMILES datasets: loads
- Property fine-tuning → SMILES datasets: loads
- Training engine → Molecular models: updates
- Training engine → Learning objectives: computes loss
- Training engine → Optimizers: steps
- Model user → Labeled SMILES: provides
- Generate molecules → SMILES generation: sets up
- Generate molecules → Sequence generation: invokes
- Interactive inference → SMILES generation: sets up
- Interactive inference → Sequence generation: invokes
- Sequence generation → Molecular models: decodes with
- Model evaluation → Property fine-tuning: evaluates
- Language-model evaluation → BERT pretraining: evaluates
- Property prediction → Molecular models: predicts with