Overview
The inference module provides the primary interface for running AlphaFold 3 predictions and handling model outputs. It includes the mainModel class for forward passes and the InferenceResult dataclass for storing predictions.
InferenceResult
Dataclass storing postprocessed model predictions and associated metadata.Attributes
The predicted protein structure containing atomic coordinates and metadata.
Useful numerical data (scalars or arrays) to be saved at inference time. Commonly includes:
full_pde: Full predicted distance error matrixfull_pae: Full predicted aligned error matrixcontact_probs: Contact probability matrix
Smaller numerical data (usually scalar) to be saved as inference metadata. Includes confidence metrics:
predicted_tm_score: Predicted TM-score (pTM)interface_predicted_tm_score: Interface pTM (ipTM)ranking_score: Overall ranking confidencefraction_disordered: Fraction of disordered residueshas_clash: Boolean indicating structural clasheschain_pair_pae_min: Minimum chain pair PAEchain_pair_pde_mean: Mean chain pair PDE
Additional dictionary for debugging, e.g., raw outputs of a model forward pass.
Model identifier used to generate this prediction.
Model Class
Full AlphaFold 3 model implementation using Haiku modules.Configuration
Configuration for the Evoformer trunk network.
Global model configuration including dtype settings.
Configuration for model heads (diffusion, confidence, distogram).
Number of recycling iterations through the trunk network.
Whether to return single and pair embeddings in output.
Whether to compute and return distogram predictions.
Forward Pass
Dictionary of input features including MSA, templates, and token features.
JAX random key for stochastic sampling. If None, uses
hk.next_rng_key().Returns
Sampled structure predictions from the diffusion head.
atom_positions: Predicted atomic coordinates
Distance distribution predictions between residues.
Predicted local distance difference test (pLDDT) scores per atom.
Full predicted aligned error matrix between all token pairs.
Full predicted distance error matrix.
Core Functions
get_predicted_structure
Converts model output to a Structure object with predicted coordinates.Dictionary containing model outputs including
diffusion_samples with atom_positions.Input batch containing layout conversion information.
get_inference_result
Class method to compute full inference results including confidence metrics.Input feature dictionary including token features and atom layouts.
Raw model output from forward pass.
Optional name for the prediction target.
create_target_feat_embedding
Creates target feature embeddings for the Evoformer module.Usage Example
Related
- Features - Input feature processing
- Post-processing - Output processing and file writing