Skip to content

Commit 96502eb

Browse files
committed
fix off-by-one for molecule ids, and make sure num_molecule_types is passed down to InputFeatureEmbedder
1 parent f64f81c commit 96502eb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

alphafold3_pytorch/alphafold3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ def __init__(
26922692
dim_single = 384,
26932693
dim_pairwise = 128,
26942694
dim_additional_token_feats = 2,
2695-
num_molecule_types = 32,
2695+
num_molecule_types = NUM_MOLECULE_IDS,
26962696
atom_transformer_blocks = 3,
26972697
atom_transformer_heads = 4,
26982698
atom_transformer_kwargs: dict = dict(),
@@ -3141,6 +3141,7 @@ def __init__(
31413141
# input feature embedder
31423142

31433143
self.input_embedder = InputFeatureEmbedder(
3144+
num_molecule_types = num_molecule_types,
31443145
dim_atom_inputs = dim_atom_inputs,
31453146
dim_atompair_inputs = dim_atompair_inputs,
31463147
atoms_per_window = atoms_per_window,

alphafold3_pytorch/inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
IS_METAL_ION_INDEX = -1
5757
IS_BIOMOLECULE_INDICES = slice(0, 3)
5858

59-
MOLECULE_GAP_ID = len(HUMAN_AMINO_ACIDS) + len(RNA_NUCLEOTIDES) + len(DNA_NUCLEOTIDES) - 1
59+
MOLECULE_GAP_ID = len(HUMAN_AMINO_ACIDS) + len(RNA_NUCLEOTIDES) + len(DNA_NUCLEOTIDES)
6060
MOLECULE_METAL_ION_ID = MOLECULE_GAP_ID + 1
6161
NUM_MOLECULE_IDS = len(HUMAN_AMINO_ACIDS) + len(RNA_NUCLEOTIDES) + len(DNA_NUCLEOTIDES) + 2
6262

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alphafold3-pytorch"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

0 commit comments

Comments
 (0)