Scoring Functions
Weight REINVENT scoring components — qed, tanimoto, physchem, custom_alerts SMARTS — to sum to 1.0, add a custom Python scorer, and apply transforms.
Scoring is what defines the target profile REINVENT optimizes toward: this page shows how to combine built-in components, weight them for multi-objective design, write custom scorers, and apply transforms. How you weight and transform the components most affects which molecules the run rewards.
Scoring Functions in REINVENT 4
REINVENT 4, developed by AstraZeneca and available under Apache 2.0 license, uses scoring functions to guide reinforcement learning optimization. Scores provide feedback that shapes the generative model (RNN or transformer) to produce molecules with desired properties.
Multi-objective optimization is achieved by combining multiple scoring components, enabling simultaneous optimization for activity, ADMET properties, and synthetic accessibility.
For the complete list of available scoring components, see the REINVENT 4 GitHub repository.
Built-in components
- QED:
name: qed - Similarity to reference:
name: tanimotowithsmilesandfp_type - Physchem filters:
name: physchemwithro5,hba,hbd,logp,tpsa - Custom Python:
name: custom_alertsfor SMARTS blocklists
Example scoring config
Weights should sum to 1.0 to keep scores interpretable.
Writing a custom component
Bundle custom components with your job so the module import path resolves inside the worker.
Tips
- Cache reference fingerprints to avoid recomputing each step.
- Guard against invalid SMILES and return 0.0 rather than raising inside custom scorers.
- Log per-component contributions during dry runs to calibrate weights before long campaigns.
Scoring strategies for different design modes
REINVENT 4 supports multiple generative modes, each benefiting from tailored scoring approaches:
De novo design
- Combine property predictors (QED, physchem) with activity models
- Use similarity constraints to stay within drug-like chemical space
- Include synthetic accessibility scores early in optimization
Scaffold hopping
- Weight Tanimoto similarity to reference compounds
- Add scaffold diversity penalties to encourage novel cores
- Include activity prediction models for target engagement
R-group replacement
- Focus scoring on the variable positions
- Use matched molecular pair analysis for SAR optimization
- Penalize groups with known liabilities (via SMARTS blocklists)
Linker design
- Score linker length and flexibility
- Include strain energy or 3D geometry constraints
- Optimize for synthetic accessibility of the final molecule
Transform functions
REINVENT 4 supports score transforms to shape the optimization landscape:
- Sigmoid: Soft thresholds for gradual property transitions
- Step: Hard cutoffs for binary constraints
- Double sigmoid: Define optimal ranges with upper and lower bounds
- Reverse sigmoid: Penalize values above a threshold
Apply transforms to convert raw predictions into normalized scores (0-1 range) suitable for RL optimization.
Was this page helpful?