deepfold package

Subpackages

Submodules

deepfold.config module

DeepFold2 model configuration.

class deepfold.config.AlphaFoldConfig(is_multimer: 'bool' = False, input_embedder_config: 'InputEmbedderConfig' = InputEmbedderConfig(tf_dim=22, msa_dim=49, c_z=128, c_m=256, relpos_k=32, max_relative_chain=2, max_relative_index=32, use_chain_relative=True), recycling_embedder_config: 'RecyclingEmbedderConfig' = RecyclingEmbedderConfig(c_m=256, c_z=128, min_bin=3.25, max_bin=20.75, num_bins=15, inf=100000000.0), template_angle_embedder_config: 'TemplateAngleEmbedderConfig' = TemplateAngleEmbedderConfig(ta_dim=57, c_m=256), template_pair_embedder_config: 'TemplatePairEmbedderConfig' = TemplatePairEmbedderConfig(tp_dim=88, c_t=64, c_z=128, c_dgram=39, c_aatype=22), template_pair_stack_config: 'TemplatePairStackConfig' = TemplatePairStackConfig(c_t=64, c_hidden_tri_att=16, c_hidden_tri_mul=64, num_blocks=2, num_heads_tri=4, pair_transition_n=2, dropout_rate=0.25, inf=1000000000.0, chunk_size_tri_att=None, block_size_tri_mul=None, tri_att_first=True), template_pointwise_attention_config: 'TemplatePointwiseAttentionConfig' = TemplatePointwiseAttentionConfig(c_t=64, c_z=128, c_hidden=16, num_heads=4, inf=100000.0, chunk_size=None), template_projection_config: 'TemplateProjectionConfig' = TemplateProjectionConfig(c_t=64, c_z=128), extra_msa_embedder_config: 'ExtraMSAEmbedderConfig' = ExtraMSAEmbedderConfig(emsa_dim=25, c_e=64), extra_msa_stack_config: 'ExtraMSAStackConfig' = ExtraMSAStackConfig(c_e=64, c_z=128, c_hidden_msa_att=8, c_hidden_opm=32, c_hidden_tri_mul=128, c_hidden_tri_att=32, num_heads_msa=8, num_heads_tri=4, num_blocks=4, transition_n=4, msa_dropout=0.15, pair_dropout=0.25, inf=1000000000.0, eps=1e-08, eps_opm=0.001, chunk_size_msa_att=None, chunk_size_opm=None, chunk_size_tri_att=None, block_size_tri_mul=None, outer_product_mean_first=False), evoformer_stack_config: 'EvoformerStackConfig' = EvoformerStackConfig(c_m=256, c_z=128, c_hidden_msa_att=32, c_hidden_opm=32, c_hidden_tri_mul=128, c_hidden_tri_att=32, c_s=384, num_heads_msa=8, num_heads_tri=4, num_blocks=48, transition_n=4, msa_dropout=0.15, pair_dropout=0.25, inf=1000000000.0, eps_opm=0.001, chunk_size_msa_att=None, chunk_size_opm=None, chunk_size_tri_att=None, block_size_tri_mul=None, outer_product_mean_first=False), structure_module_config: 'StructureModuleConfig' = StructureModuleConfig(c_s=384, c_z=128, c_hidden_ipa=16, c_hidden_ang_res=128, num_heads_ipa=12, num_qk_points=4, num_v_points=8, is_multimer=False, dropout_rate=0.1, num_blocks=8, num_ang_res_blocks=2, num_angles=7, scale_factor=10.0, inf=100000.0, eps=1e-08), auxiliary_heads_config: 'AuxiliaryHeadsConfig' = AuxiliaryHeadsConfig(per_residue_lddt_ca_predictor_config=PerResidueLDDTCaPredictorConfig(c_s=384, c_hidden=128, num_bins=50), distogram_head_config=DistogramHeadConfig(c_z=128, num_bins=64), masked_msa_head_config=MaskedMSAHeadConfig(c_m=256, c_out=23), experimentally_resolved_head_config=ExperimentallyResolvedHeadConfig(c_s=384, c_out=37), tm_score_head_config=TMScoreHeadConfig(c_z=128, num_bins=64, max_bin=31), tm_score_head_enabled=False, ptm_weight=0.2, iptm_weight=0.8), loss_config: 'LossConfig' = LossConfig(fape_loss_config=FAPELossConfig(weight=1.0, backbone_clamp_distance=10.0, backbone_loss_unit_distance=10.0, backbone_weight=0.5, interface_clamp_distance=30.0, interface_loss_unit_distance=20.0, interface_weight=0.5, sidechain_clamp_distance=10.0, sidechain_length_scale=10.0, sidechain_weight=0.5, eps=0.0001), supervised_chi_loss_config=SupervisedChiLossConfig(weight=1.0, chi_weight=0.5, angle_norm_weight=0.01, eps=1e-08), distogram_loss_config=DistogramLossConfig(weight=0.3, min_bin=2.3125, max_bin=21.6875, num_bins=64, eps=1e-08), masked_msa_loss_config=MaskedMSALossConfig(weight=2.0, eps=1e-08, num_classes=23), plddt_loss_config=PLDDTLossConfig(weight=0.01, cutoff=15.0, min_resolution=0.1, max_resolution=3.0, num_bins=50, eps=1e-08), experimentally_resolved_loss_config=ExperimentallyResolvedLossConfig(weight=0.0, min_resolution=0.1, max_resolution=3.0, eps=1e-08), violation_loss_config=ViolationLossConfig(weight=0.0, violation_tolerance_factor=12.0, average_clashes=False, clash_overlap_tolerance=1.5, eps=1e-06), tm_loss_config=TMLossConfig(enabled=False, weight=0.0, min_resolution=0.1, max_resolution=3.0, num_bins=64, max_bin=31, eps=1e-08), chain_center_of_mass_config=CenterOfMassConfig(enabled=False, clamp_distance=-4.0, eps=1e-10, weight=0.05)), recycle_early_stop_enabled: 'bool' = False, recycle_early_stop_tolerance: 'float' = 0.5, templates_enabled: 'bool' = True, embed_template_torsion_angles: 'bool' = True, template_pair_feat_distogram_min_bin: 'float' = 3.25, template_pair_feat_distogram_max_bin: 'float' = 50.75, template_pair_feat_distogram_num_bins: 'int' = 39, template_pair_feat_use_unit_vector: 'bool' = False, template_pair_feat_inf: 'float' = 100000.0, template_pair_feat_eps: 'float' = 1e-06)

Bases: object

auxiliary_heads_config: AuxiliaryHeadsConfig = AuxiliaryHeadsConfig(per_residue_lddt_ca_predictor_config=PerResidueLDDTCaPredictorConfig(c_s=384, c_hidden=128, num_bins=50), distogram_head_config=DistogramHeadConfig(c_z=128, num_bins=64), masked_msa_head_config=MaskedMSAHeadConfig(c_m=256, c_out=23), experimentally_resolved_head_config=ExperimentallyResolvedHeadConfig(c_s=384, c_out=37), tm_score_head_config=TMScoreHeadConfig(c_z=128, num_bins=64, max_bin=31), tm_score_head_enabled=False, ptm_weight=0.2, iptm_weight=0.8)
embed_template_torsion_angles: bool = True
evoformer_stack_config: EvoformerStackConfig = EvoformerStackConfig(c_m=256, c_z=128, c_hidden_msa_att=32, c_hidden_opm=32, c_hidden_tri_mul=128, c_hidden_tri_att=32, c_s=384, num_heads_msa=8, num_heads_tri=4, num_blocks=48, transition_n=4, msa_dropout=0.15, pair_dropout=0.25, inf=1000000000.0, eps_opm=0.001, chunk_size_msa_att=None, chunk_size_opm=None, chunk_size_tri_att=None, block_size_tri_mul=None, outer_product_mean_first=False)
extra_msa_embedder_config: ExtraMSAEmbedderConfig = ExtraMSAEmbedderConfig(emsa_dim=25, c_e=64)
extra_msa_stack_config: ExtraMSAStackConfig = ExtraMSAStackConfig(c_e=64, c_z=128, c_hidden_msa_att=8, c_hidden_opm=32, c_hidden_tri_mul=128, c_hidden_tri_att=32, num_heads_msa=8, num_heads_tri=4, num_blocks=4, transition_n=4, msa_dropout=0.15, pair_dropout=0.25, inf=1000000000.0, eps=1e-08, eps_opm=0.001, chunk_size_msa_att=None, chunk_size_opm=None, chunk_size_tri_att=None, block_size_tri_mul=None, outer_product_mean_first=False)
classmethod from_dict(cfg: dict) AlphaFoldConfig
classmethod from_preset(is_multimer: bool = False, precision: str = 'fp32', enable_ptm: bool = False, enable_templates: bool = False, inference_chunk_size: int | None = 4, inference_block_size: int | None = None, **additional_options) AlphaFoldConfig
input_embedder_config: InputEmbedderConfig = InputEmbedderConfig(tf_dim=22, msa_dim=49, c_z=128, c_m=256, relpos_k=32, max_relative_chain=2, max_relative_index=32, use_chain_relative=True)
is_multimer: bool = False
loss_config: LossConfig = LossConfig(fape_loss_config=FAPELossConfig(weight=1.0, backbone_clamp_distance=10.0, backbone_loss_unit_distance=10.0, backbone_weight=0.5, interface_clamp_distance=30.0, interface_loss_unit_distance=20.0, interface_weight=0.5, sidechain_clamp_distance=10.0, sidechain_length_scale=10.0, sidechain_weight=0.5, eps=0.0001), supervised_chi_loss_config=SupervisedChiLossConfig(weight=1.0, chi_weight=0.5, angle_norm_weight=0.01, eps=1e-08), distogram_loss_config=DistogramLossConfig(weight=0.3, min_bin=2.3125, max_bin=21.6875, num_bins=64, eps=1e-08), masked_msa_loss_config=MaskedMSALossConfig(weight=2.0, eps=1e-08, num_classes=23), plddt_loss_config=PLDDTLossConfig(weight=0.01, cutoff=15.0, min_resolution=0.1, max_resolution=3.0, num_bins=50, eps=1e-08), experimentally_resolved_loss_config=ExperimentallyResolvedLossConfig(weight=0.0, min_resolution=0.1, max_resolution=3.0, eps=1e-08), violation_loss_config=ViolationLossConfig(weight=0.0, violation_tolerance_factor=12.0, average_clashes=False, clash_overlap_tolerance=1.5, eps=1e-06), tm_loss_config=TMLossConfig(enabled=False, weight=0.0, min_resolution=0.1, max_resolution=3.0, num_bins=64, max_bin=31, eps=1e-08), chain_center_of_mass_config=CenterOfMassConfig(enabled=False, clamp_distance=-4.0, eps=1e-10, weight=0.05))
recycle_early_stop_enabled: bool = False
recycle_early_stop_tolerance: float = 0.5
recycling_embedder_config: RecyclingEmbedderConfig = RecyclingEmbedderConfig(c_m=256, c_z=128, min_bin=3.25, max_bin=20.75, num_bins=15, inf=100000000.0)
structure_module_config: StructureModuleConfig = StructureModuleConfig(c_s=384, c_z=128, c_hidden_ipa=16, c_hidden_ang_res=128, num_heads_ipa=12, num_qk_points=4, num_v_points=8, is_multimer=False, dropout_rate=0.1, num_blocks=8, num_ang_res_blocks=2, num_angles=7, scale_factor=10.0, inf=100000.0, eps=1e-08)
template_angle_embedder_config: TemplateAngleEmbedderConfig = TemplateAngleEmbedderConfig(ta_dim=57, c_m=256)
template_pair_embedder_config: TemplatePairEmbedderConfig = TemplatePairEmbedderConfig(tp_dim=88, c_t=64, c_z=128, c_dgram=39, c_aatype=22)
template_pair_feat_distogram_max_bin: float = 50.75
template_pair_feat_distogram_min_bin: float = 3.25
template_pair_feat_distogram_num_bins: int = 39
template_pair_feat_eps: float = 1e-06
template_pair_feat_inf: float = 100000.0
template_pair_feat_use_unit_vector: bool = False
template_pair_stack_config: TemplatePairStackConfig = TemplatePairStackConfig(c_t=64, c_hidden_tri_att=16, c_hidden_tri_mul=64, num_blocks=2, num_heads_tri=4, pair_transition_n=2, dropout_rate=0.25, inf=1000000000.0, chunk_size_tri_att=None, block_size_tri_mul=None, tri_att_first=True)
template_pointwise_attention_config: TemplatePointwiseAttentionConfig = TemplatePointwiseAttentionConfig(c_t=64, c_z=128, c_hidden=16, num_heads=4, inf=100000.0, chunk_size=None)
template_projection_config: TemplateProjectionConfig = TemplateProjectionConfig(c_t=64, c_z=128)
templates_enabled: bool = True
to_dict() dict
class deepfold.config.AuxiliaryHeadsConfig(per_residue_lddt_ca_predictor_config: 'PerResidueLDDTCaPredictorConfig' = PerResidueLDDTCaPredictorConfig(c_s=384, c_hidden=128, num_bins=50), distogram_head_config: 'DistogramHeadConfig' = DistogramHeadConfig(c_z=128, num_bins=64), masked_msa_head_config: 'MaskedMSAHeadConfig' = MaskedMSAHeadConfig(c_m=256, c_out=23), experimentally_resolved_head_config: 'ExperimentallyResolvedHeadConfig' = ExperimentallyResolvedHeadConfig(c_s=384, c_out=37), tm_score_head_config: 'TMScoreHeadConfig' = TMScoreHeadConfig(c_z=128, num_bins=64, max_bin=31), tm_score_head_enabled: 'bool' = False, ptm_weight: 'float' = 0.2, iptm_weight: 'float' = 0.8)

Bases: object

distogram_head_config: DistogramHeadConfig = DistogramHeadConfig(c_z=128, num_bins=64)
experimentally_resolved_head_config: ExperimentallyResolvedHeadConfig = ExperimentallyResolvedHeadConfig(c_s=384, c_out=37)
iptm_weight: float = 0.8
masked_msa_head_config: MaskedMSAHeadConfig = MaskedMSAHeadConfig(c_m=256, c_out=23)
per_residue_lddt_ca_predictor_config: PerResidueLDDTCaPredictorConfig = PerResidueLDDTCaPredictorConfig(c_s=384, c_hidden=128, num_bins=50)
ptm_weight: float = 0.2
tm_score_head_config: TMScoreHeadConfig = TMScoreHeadConfig(c_z=128, num_bins=64, max_bin=31)
tm_score_head_enabled: bool = False
class deepfold.config.CenterOfMassConfig(enabled: 'bool' = False, clamp_distance: 'float' = -4.0, eps: 'float' = 1e-10, weight: 'float' = 0.05)

Bases: object

clamp_distance: float = -4.0
enabled: bool = False
eps: float = 1e-10
weight: float = 0.05
class deepfold.config.DistogramHeadConfig(c_z: 'int' = 128, num_bins: 'int' = 64)

Bases: object

c_z: int = 128
num_bins: int = 64
class deepfold.config.DistogramLossConfig(weight: 'float' = 0.3, min_bin: 'float' = 2.3125, max_bin: 'float' = 21.6875, num_bins: 'int' = 64, eps: 'float' = 1e-08)

Bases: object

eps: float = 1e-08
max_bin: float = 21.6875
min_bin: float = 2.3125
num_bins: int = 64
weight: float = 0.3
class deepfold.config.EvoformerStackConfig(c_m: 'int' = 256, c_z: 'int' = 128, c_hidden_msa_att: 'int' = 32, c_hidden_opm: 'int' = 32, c_hidden_tri_mul: 'int' = 128, c_hidden_tri_att: 'int' = 32, c_s: 'int' = 384, num_heads_msa: 'int' = 8, num_heads_tri: 'int' = 4, num_blocks: 'int' = 48, transition_n: 'int' = 4, msa_dropout: 'float' = 0.15, pair_dropout: 'float' = 0.25, inf: 'float' = 1000000000.0, eps_opm: 'float' = 0.001, chunk_size_msa_att: 'Optional[int]' = None, chunk_size_opm: 'Optional[int]' = None, chunk_size_tri_att: 'Optional[int]' = None, block_size_tri_mul: 'Optional[int]' = None, outer_product_mean_first: 'bool' = False)

Bases: object

block_size_tri_mul: int | None = None
c_hidden_msa_att: int = 32
c_hidden_opm: int = 32
c_hidden_tri_att: int = 32
c_hidden_tri_mul: int = 128
c_m: int = 256
c_s: int = 384
c_z: int = 128
chunk_size_msa_att: int | None = None
chunk_size_opm: int | None = None
chunk_size_tri_att: int | None = None
eps_opm: float = 0.001
inf: float = 1000000000.0
msa_dropout: float = 0.15
num_blocks: int = 48
num_heads_msa: int = 8
num_heads_tri: int = 4
outer_product_mean_first: bool = False
pair_dropout: float = 0.25
transition_n: int = 4
class deepfold.config.ExperimentallyResolvedHeadConfig(c_s: 'int' = 384, c_out: 'int' = 37)

Bases: object

c_out: int = 37
c_s: int = 384
class deepfold.config.ExperimentallyResolvedLossConfig(weight: 'float' = 0.0, min_resolution: 'float' = 0.1, max_resolution: 'float' = 3.0, eps: 'float' = 1e-08)

Bases: object

eps: float = 1e-08
max_resolution: float = 3.0
min_resolution: float = 0.1
weight: float = 0.0
class deepfold.config.ExtraMSAEmbedderConfig(emsa_dim: 'int' = 25, c_e: 'int' = 64)

Bases: object

c_e: int = 64
emsa_dim: int = 25
class deepfold.config.ExtraMSAStackConfig(c_e: 'int' = 64, c_z: 'int' = 128, c_hidden_msa_att: 'int' = 8, c_hidden_opm: 'int' = 32, c_hidden_tri_mul: 'int' = 128, c_hidden_tri_att: 'int' = 32, num_heads_msa: 'int' = 8, num_heads_tri: 'int' = 4, num_blocks: 'int' = 4, transition_n: 'int' = 4, msa_dropout: 'float' = 0.15, pair_dropout: 'float' = 0.25, inf: 'float' = 1000000000.0, eps: 'float' = 1e-08, eps_opm: 'float' = 0.001, chunk_size_msa_att: 'Optional[int]' = None, chunk_size_opm: 'Optional[int]' = None, chunk_size_tri_att: 'Optional[int]' = None, block_size_tri_mul: 'Optional[int]' = None, outer_product_mean_first: 'bool' = False)

Bases: object

block_size_tri_mul: int | None = None
c_e: int = 64
c_hidden_msa_att: int = 8
c_hidden_opm: int = 32
c_hidden_tri_att: int = 32
c_hidden_tri_mul: int = 128
c_z: int = 128
chunk_size_msa_att: int | None = None
chunk_size_opm: int | None = None
chunk_size_tri_att: int | None = None
eps: float = 1e-08
eps_opm: float = 0.001
inf: float = 1000000000.0
msa_dropout: float = 0.15
num_blocks: int = 4
num_heads_msa: int = 8
num_heads_tri: int = 4
outer_product_mean_first: bool = False
pair_dropout: float = 0.25
transition_n: int = 4
class deepfold.config.FAPELossConfig(weight: 'float' = 1.0, backbone_clamp_distance: 'float' = 10.0, backbone_loss_unit_distance: 'float' = 10.0, backbone_weight: 'float' = 0.5, interface_clamp_distance: 'float' = 30.0, interface_loss_unit_distance: 'float' = 20.0, interface_weight: 'float' = 0.5, sidechain_clamp_distance: 'float' = 10.0, sidechain_length_scale: 'float' = 10.0, sidechain_weight: 'float' = 0.5, eps: 'float' = 0.0001)

Bases: object

backbone_clamp_distance: float = 10.0
backbone_loss_unit_distance: float = 10.0
backbone_weight: float = 0.5
eps: float = 0.0001
interface_clamp_distance: float = 30.0
interface_loss_unit_distance: float = 20.0
interface_weight: float = 0.5
sidechain_clamp_distance: float = 10.0
sidechain_length_scale: float = 10.0
sidechain_weight: float = 0.5
weight: float = 1.0
class deepfold.config.FeaturePipelineConfig(preset: 'str' = '', is_multimer: 'bool' = False, seed: 'int' = 0, num_chunks: 'int' = 8, fixed_size: 'bool' = True, max_msa_clusters: 'int' = 128, max_extra_msa: 'int' = 1024, sample_msa_distillation_enabled: 'bool' = False, max_distillation_msa_clusters: 'int' = 1000, block_delete_msa_enabled: 'bool' = True, msa_fraction_per_deletion_block: 'float' = 0.3, randomize_num_msa_deletion_blocks: 'bool' = False, num_msa_deletion_blocks: 'int' = 5, masked_msa_enabled: 'bool' = True, masked_msa_profile_prob: 'float' = 0.1, masked_msa_same_prob: 'float' = 0.1, masked_msa_uniform_prob: 'float' = 0.1, masked_msa_replace_fraction: 'float' = 0.15, max_recycling_iters: 'int' = 3, resample_msa_in_recycling: 'bool' = True, residue_cropping_enabled: 'bool' = False, crop_size: 'int' = 256, spatial_crop_prob: 'float' = 0.5, interface_threshold: 'float' = 10.0, primary_raw_feature_names: 'List[str]' = <factory>, msa_cluster_features_enabled: 'bool' = True, templates_enabled: 'bool' = True, embed_template_torsion_angles: 'bool' = True, max_templates: 'int' = 4, shuffle_top_k_prefiltered: 'int' = 20, subsample_templates: 'bool' = False, template_raw_feature_names: 'List[str]' = <factory>, supervised_features_enabled: 'bool' = False, supervised_raw_feature_names: 'List[str]' = <factory>, clamped_fape_enabled: 'bool' = False, clamped_fape_probability: 'float' = 0.9, self_distillation_plddt_threshold: 'float' = 50.0)

Bases: object

block_delete_msa_enabled: bool = True
clamped_fape_enabled: bool = False
clamped_fape_probability: float = 0.9
crop_size: int = 256
embed_template_torsion_angles: bool = True
feature_names() List[str]
fixed_size: bool = True
classmethod from_dict(cfg: dict) FeaturePipelineConfig
classmethod from_preset(preset: str, seed: int, is_multimer: bool = False, **additional_options) FeaturePipelineConfig
interface_threshold: float = 10.0
is_multimer: bool = False
masked_msa_enabled: bool = True
masked_msa_profile_prob: float = 0.1
masked_msa_replace_fraction: float = 0.15
masked_msa_same_prob: float = 0.1
masked_msa_uniform_prob: float = 0.1
max_distillation_msa_clusters: int = 1000
max_extra_msa: int = 1024
max_msa_clusters: int = 128
max_recycling_iters: int = 3
max_templates: int = 4
msa_cluster_features_enabled: bool = True
msa_fraction_per_deletion_block: float = 0.3
num_chunks: int = 8
num_msa_deletion_blocks: int = 5
preset: str = ''
primary_raw_feature_names: List[str]
randomize_num_msa_deletion_blocks: bool = False
resample_msa_in_recycling: bool = True
residue_cropping_enabled: bool = False
sample_msa_distillation_enabled: bool = False
seed: int = 0
self_distillation_plddt_threshold: float = 50.0
shuffle_top_k_prefiltered: int = 20
spatial_crop_prob: float = 0.5
subsample_templates: bool = False
supervised_features_enabled: bool = False
supervised_raw_feature_names: List[str]
template_raw_feature_names: List[str]
templates_enabled: bool = True
to_dict() dict
class deepfold.config.InputEmbedderConfig(tf_dim: 'int' = 22, msa_dim: 'int' = 49, c_z: 'int' = 128, c_m: 'int' = 256, relpos_k: 'int' = 32, max_relative_chain: 'int' = 2, max_relative_index: 'int' = 32, use_chain_relative: 'bool' = True)

Bases: object

c_m: int = 256
c_z: int = 128
max_relative_chain: int = 2
max_relative_index: int = 32
msa_dim: int = 49
relpos_k: int = 32
tf_dim: int = 22
use_chain_relative: bool = True
class deepfold.config.LossConfig(fape_loss_config: 'FAPELossConfig' = FAPELossConfig(weight=1.0, backbone_clamp_distance=10.0, backbone_loss_unit_distance=10.0, backbone_weight=0.5, interface_clamp_distance=30.0, interface_loss_unit_distance=20.0, interface_weight=0.5, sidechain_clamp_distance=10.0, sidechain_length_scale=10.0, sidechain_weight=0.5, eps=0.0001), supervised_chi_loss_config: 'SupervisedChiLossConfig' = SupervisedChiLossConfig(weight=1.0, chi_weight=0.5, angle_norm_weight=0.01, eps=1e-08), distogram_loss_config: 'DistogramLossConfig' = DistogramLossConfig(weight=0.3, min_bin=2.3125, max_bin=21.6875, num_bins=64, eps=1e-08), masked_msa_loss_config: 'MaskedMSALossConfig' = MaskedMSALossConfig(weight=2.0, eps=1e-08, num_classes=23), plddt_loss_config: 'PLDDTLossConfig' = PLDDTLossConfig(weight=0.01, cutoff=15.0, min_resolution=0.1, max_resolution=3.0, num_bins=50, eps=1e-08), experimentally_resolved_loss_config: 'ExperimentallyResolvedLossConfig' = ExperimentallyResolvedLossConfig(weight=0.0, min_resolution=0.1, max_resolution=3.0, eps=1e-08), violation_loss_config: 'ViolationLossConfig' = ViolationLossConfig(weight=0.0, violation_tolerance_factor=12.0, average_clashes=False, clash_overlap_tolerance=1.5, eps=1e-06), tm_loss_config: 'TMLossConfig' = TMLossConfig(enabled=False, weight=0.0, min_resolution=0.1, max_resolution=3.0, num_bins=64, max_bin=31, eps=1e-08), chain_center_of_mass_config: 'CenterOfMassConfig' = CenterOfMassConfig(enabled=False, clamp_distance=-4.0, eps=1e-10, weight=0.05))

Bases: object

chain_center_of_mass_config: CenterOfMassConfig = CenterOfMassConfig(enabled=False, clamp_distance=-4.0, eps=1e-10, weight=0.05)
distogram_loss_config: DistogramLossConfig = DistogramLossConfig(weight=0.3, min_bin=2.3125, max_bin=21.6875, num_bins=64, eps=1e-08)
experimentally_resolved_loss_config: ExperimentallyResolvedLossConfig = ExperimentallyResolvedLossConfig(weight=0.0, min_resolution=0.1, max_resolution=3.0, eps=1e-08)
fape_loss_config: FAPELossConfig = FAPELossConfig(weight=1.0, backbone_clamp_distance=10.0, backbone_loss_unit_distance=10.0, backbone_weight=0.5, interface_clamp_distance=30.0, interface_loss_unit_distance=20.0, interface_weight=0.5, sidechain_clamp_distance=10.0, sidechain_length_scale=10.0, sidechain_weight=0.5, eps=0.0001)
masked_msa_loss_config: MaskedMSALossConfig = MaskedMSALossConfig(weight=2.0, eps=1e-08, num_classes=23)
plddt_loss_config: PLDDTLossConfig = PLDDTLossConfig(weight=0.01, cutoff=15.0, min_resolution=0.1, max_resolution=3.0, num_bins=50, eps=1e-08)
supervised_chi_loss_config: SupervisedChiLossConfig = SupervisedChiLossConfig(weight=1.0, chi_weight=0.5, angle_norm_weight=0.01, eps=1e-08)
tm_loss_config: TMLossConfig = TMLossConfig(enabled=False, weight=0.0, min_resolution=0.1, max_resolution=3.0, num_bins=64, max_bin=31, eps=1e-08)
violation_loss_config: ViolationLossConfig = ViolationLossConfig(weight=0.0, violation_tolerance_factor=12.0, average_clashes=False, clash_overlap_tolerance=1.5, eps=1e-06)
class deepfold.config.MaskedMSAHeadConfig(c_m: 'int' = 256, c_out: 'int' = 23)

Bases: object

c_m: int = 256
c_out: int = 23
class deepfold.config.MaskedMSALossConfig(weight: 'float' = 2.0, eps: 'float' = 1e-08, num_classes: 'int' = 23)

Bases: object

eps: float = 1e-08
num_classes: int = 23
weight: float = 2.0
class deepfold.config.PLDDTLossConfig(weight: 'float' = 0.01, cutoff: 'float' = 15.0, min_resolution: 'float' = 0.1, max_resolution: 'float' = 3.0, num_bins: 'int' = 50, eps: 'float' = 1e-08)

Bases: object

cutoff: float = 15.0
eps: float = 1e-08
max_resolution: float = 3.0
min_resolution: float = 0.1
num_bins: int = 50
weight: float = 0.01
class deepfold.config.PerResidueLDDTCaPredictorConfig(c_s: 'int' = 384, c_hidden: 'int' = 128, num_bins: 'int' = 50)

Bases: object

c_hidden: int = 128
c_s: int = 384
num_bins: int = 50
class deepfold.config.RecyclingEmbedderConfig(c_m: 'int' = 256, c_z: 'int' = 128, min_bin: 'float' = 3.25, max_bin: 'float' = 20.75, num_bins: 'int' = 15, inf: 'float' = 100000000.0)

Bases: object

c_m: int = 256
c_z: int = 128
inf: float = 100000000.0
max_bin: float = 20.75
min_bin: float = 3.25
num_bins: int = 15
class deepfold.config.StructureModuleConfig(c_s: 'int' = 384, c_z: 'int' = 128, c_hidden_ipa: 'int' = 16, c_hidden_ang_res: 'int' = 128, num_heads_ipa: 'int' = 12, num_qk_points: 'int' = 4, num_v_points: 'int' = 8, is_multimer: 'bool' = False, dropout_rate: 'float' = 0.1, num_blocks: 'int' = 8, num_ang_res_blocks: 'int' = 2, num_angles: 'int' = 7, scale_factor: 'float' = 10.0, inf: 'float' = 100000.0, eps: 'float' = 1e-08)

Bases: object

c_hidden_ang_res: int = 128
c_hidden_ipa: int = 16
c_s: int = 384
c_z: int = 128
dropout_rate: float = 0.1
eps: float = 1e-08
inf: float = 100000.0
is_multimer: bool = False
num_ang_res_blocks: int = 2
num_angles: int = 7
num_blocks: int = 8
num_heads_ipa: int = 12
num_qk_points: int = 4
num_v_points: int = 8
scale_factor: float = 10.0
class deepfold.config.SupervisedChiLossConfig(weight: 'float' = 1.0, chi_weight: 'float' = 0.5, angle_norm_weight: 'float' = 0.01, eps: 'float' = 1e-08)

Bases: object

angle_norm_weight: float = 0.01
chi_weight: float = 0.5
eps: float = 1e-08
weight: float = 1.0
class deepfold.config.TMLossConfig(enabled: 'bool' = False, weight: 'float' = 0.0, min_resolution: 'float' = 0.1, max_resolution: 'float' = 3.0, num_bins: 'int' = 64, max_bin: 'int' = 31, eps: 'float' = 1e-08)

Bases: object

enabled: bool = False
eps: float = 1e-08
max_bin: int = 31
max_resolution: float = 3.0
min_resolution: float = 0.1
num_bins: int = 64
weight: float = 0.0
class deepfold.config.TMScoreHeadConfig(c_z: 'int' = 128, num_bins: 'int' = 64, max_bin: 'int' = 31)

Bases: object

c_z: int = 128
max_bin: int = 31
num_bins: int = 64
class deepfold.config.TemplateAngleEmbedderConfig(ta_dim: 'int' = 57, c_m: 'int' = 256)

Bases: object

c_m: int = 256
ta_dim: int = 57
class deepfold.config.TemplatePairEmbedderConfig(tp_dim: 'int' = 88, c_t: 'int' = 64, c_z: 'int' = 128, c_dgram: 'int' = 39, c_aatype: 'int' = 22)

Bases: object

c_aatype: int = 22
c_dgram: int = 39
c_t: int = 64
c_z: int = 128
tp_dim: int = 88
class deepfold.config.TemplatePairStackConfig(c_t: 'int' = 64, c_hidden_tri_att: 'int' = 16, c_hidden_tri_mul: 'int' = 64, num_blocks: 'int' = 2, num_heads_tri: 'int' = 4, pair_transition_n: 'int' = 2, dropout_rate: 'float' = 0.25, inf: 'float' = 1000000000.0, chunk_size_tri_att: 'Optional[int]' = None, block_size_tri_mul: 'Optional[int]' = None, tri_att_first: 'bool' = True)

Bases: object

block_size_tri_mul: int | None = None
c_hidden_tri_att: int = 16
c_hidden_tri_mul: int = 64
c_t: int = 64
chunk_size_tri_att: int | None = None
dropout_rate: float = 0.25
inf: float = 1000000000.0
num_blocks: int = 2
num_heads_tri: int = 4
pair_transition_n: int = 2
tri_att_first: bool = True
class deepfold.config.TemplatePointwiseAttentionConfig(c_t: 'int' = 64, c_z: 'int' = 128, c_hidden: 'int' = 16, num_heads: 'int' = 4, inf: 'float' = 100000.0, chunk_size: 'Optional[int]' = None)

Bases: object

c_hidden: int = 16
c_t: int = 64
c_z: int = 128
chunk_size: int | None = None
inf: float = 100000.0
num_heads: int = 4
class deepfold.config.TemplateProjectionConfig(c_t: 'int' = 64, c_z: 'int' = 128)

Bases: object

c_t: int = 64
c_z: int = 128
class deepfold.config.TrainingConfig(gradient_clipping: 'bool' = True, clip_grad_max_nrom: 'float' = 0.1, swa_enabled: 'bool' = True, swa_decay_rate: 'float' = 0.9)

Bases: object

clip_grad_max_nrom: float = 0.1
classmethod from_dict(cfg: dict) TrainingConfig
classmethod from_preset(**additional_options) TrainingConfig
gradient_clipping: bool = True
optimizer_adam_amsgrad = False
optimizer_adam_beta_1 = 0.9
optimizer_adam_beta_2 = 0.999
optimizer_adam_eps = 1e-06
optimizer_adam_weight_decay = 0.0
swa_decay_rate: float = 0.9
swa_enabled: bool = True
to_dict() dict
class deepfold.config.ViolationLossConfig(weight: 'float' = 0.0, violation_tolerance_factor: 'float' = 12.0, average_clashes: 'bool' = False, clash_overlap_tolerance: 'float' = 1.5, eps: 'float' = 1e-06)

Bases: object

average_clashes: bool = False
clash_overlap_tolerance: float = 1.5
eps: float = 1e-06
violation_tolerance_factor: float = 12.0
weight: float = 0.0

deepfold.loss module

class deepfold.loss.AlphaFoldLoss(config: LossConfig)

Bases: PatchedModule

AlphaFold loss module.

Supplementary ‘1.9 Loss functions and auxiliary heads’.

forward(outputs: Dict[str, Tensor], batch: Dict[str, Tensor]) Tuple[Tensor, Dict[str, Tensor]]

AlphaFold loss forward pass.

Parameters:
  • outputs – forward pass output dict

  • batch – train batch dict

Returns:

total loss connected to the graph losses: dict with loss detached from the graph

Return type:

scaled_weight_total_loss

deepfold.package_info module

Package constants.

Module contents