How nvidia-digital-bio/reasyn works
Project type and purpose
• This is a research-grade, full-pipeline machine learning framework for molecular synthesizability (“ReaSyn”).
• It provides:
• Data preparation and featurization of chemical building blocks and reaction templates
• A PyTorch-based sequence-to-sequence model (encoder/decoder with chain-of-reaction notation)
• Training (supervised and RL-based finetuning)
• Inference (sampling, reconstruction, optimization, hit expansion, pathway filtering)
• Evaluation scripts
File structure
Top-level directories:
• assets, data, data_card, license_data, license_thirdparty, model_card: static assets, data set organization, documentation
• configs: YAML configs for preprocessing, training, finetuning
• reasyn: core Python package with subpackages:
• chem: molecule/reaction representations, featurization, fingerprint indexing
• data: dataset, collate helper, common utilities
• models: encoder, decoder, transformer-style model “reasyn,” classifier/regressor heads
• sampler: parallel sampling engine, state pool
• trainer: supervised (autoregressive) and RL finetuning modules
• utils: mutation, crossover, CLI training loop helpers
• scripts: CLI entrypoints for preprocess, train, finetune, sample, eval, optimize
• env.yml, pyproject.toml: environment and packaging
• data/processed, data/building_blocks, data/rxn_templates etc.: raw vs. preprocessed data hierarchy
README for additional insights
• Workflow stages:
1. Data Preparation using scripts/preprocess.py + building blocks / reaction templates
2. Supervised training via scripts/train.py (distributed with torchrun)
3. RL finetuning with scripts/finetune.py
4. Inference/Sampling with scripts/sample.py + evaluation (eval_recon.py, eval_hit.py, optimize_tdc.py)
• Key technologies: Python, PyTorch (torchrun), YAML configs, GPU clusters, external SynFormer dependency
Don’t overthink
• Enumerate each logical component even if it seems small (e.g., utils, sampler)
• The goal is to capture all moving parts in a clear, layered view
• Detail is better than abstraction for maintainability and onboarding