Skip to main content

Overview

The inference module provides the primary interface for running AlphaFold 3 predictions and handling model outputs. It includes the main Model class for forward passes and the InferenceResult dataclass for storing predictions.

InferenceResult

Dataclass storing postprocessed model predictions and associated metadata.

Attributes

structure.Structure
required
The predicted protein structure containing atomic coordinates and metadata.
Mapping[str, float | int | np.ndarray]
Useful numerical data (scalars or arrays) to be saved at inference time. Commonly includes:
  • full_pde: Full predicted distance error matrix
  • full_pae: Full predicted aligned error matrix
  • contact_probs: Contact probability matrix
Mapping[str, float | int | np.ndarray]
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 confidence
  • fraction_disordered: Fraction of disordered residues
  • has_clash: Boolean indicating structural clashes
  • chain_pair_pae_min: Minimum chain pair PAE
  • chain_pair_pde_mean: Mean chain pair PDE
Mapping[str, Any]
Additional dictionary for debugging, e.g., raw outputs of a model forward pass.
bytes
Model identifier used to generate this prediction.

Model Class

Full AlphaFold 3 model implementation using Haiku modules.

Configuration

evoformer_network.Evoformer.Config
Configuration for the Evoformer trunk network.
model_config.GlobalConfig
Global model configuration including dtype settings.
Model.HeadsConfig
Configuration for model heads (diffusion, confidence, distogram).
int
default:10
Number of recycling iterations through the trunk network.
bool
default:false
Whether to return single and pair embeddings in output.
bool
default:false
Whether to compute and return distogram predictions.

Forward Pass

features.BatchDict
required
Dictionary of input features including MSA, templates, and token features.
jax.Array | None
JAX random key for stochastic sampling. If None, uses hk.next_rng_key().

Returns

dict
Sampled structure predictions from the diffusion head.
  • atom_positions: Predicted atomic coordinates
dict
Distance distribution predictions between residues.
np.ndarray
Predicted local distance difference test (pLDDT) scores per atom.
np.ndarray
Full predicted aligned error matrix between all token pairs.
np.ndarray
Full predicted distance error matrix.

Core Functions

get_predicted_structure

Converts model output to a Structure object with predicted coordinates.
ModelResult
required
Dictionary containing model outputs including diffusion_samples with atom_positions.
feat_batch.Batch
required
Input batch containing layout conversion information.

get_inference_result

Class method to compute full inference results including confidence metrics.
features.BatchDict
required
Input feature dictionary including token features and atom layouts.
ModelResult
required
Raw model output from forward pass.
str
Optional name for the prediction target.

create_target_feat_embedding

Creates target feature embeddings for the Evoformer module.

Usage Example