Skip to content

Commit

Permalink
[FEAT][AlphaFold3]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed May 9, 2024
1 parent b7c4f34 commit 9c7a47b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,37 @@ print(output_coords)
print(loss)
```

## Full Model Example Forward pass

```python
import torch
from alphafold3 import AlphaFold3

# Create random tensors
x = torch.randn(1, 5, 5, 64) # Shape: (batch_size, seq_len, seq_len, dim)
y = torch.randn(1, 5, 64) # Shape: (batch_size, seq_len, dim)

# Initialize AlphaFold3 model
model = AlphaFold3(
dim=64,
seq_len=5,
heads=8,
dim_head=64,
attn_dropout=0.0,
ff_dropout=0.0,
global_column_attn=False,
pair_former_depth=48,
num_diffusion_steps=1000,
diffusion_depth=30,
)

# Forward pass through the model
output = model(x, y)

# Print the shape of the output tensor
print(output.shape)
```


# Citation
```bibtex
Expand Down
10 changes: 8 additions & 2 deletions model_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import torch
from alphafold3 import AlphaFold3

x = torch.randn(1, 5, 5, 64)
y = torch.randn(1, 5, 64)
# Create random tensors
x = torch.randn(1, 5, 5, 64) # Shape: (batch_size, seq_len, seq_len, dim)
y = torch.randn(1, 5, 64) # Shape: (batch_size, seq_len, dim)

# Initialize AlphaFold3 model
model = AlphaFold3(
dim=64,
seq_len=5,
Expand All @@ -16,5 +18,9 @@
num_diffusion_steps=1000,
diffusion_depth=30,
)

# Forward pass through the model
output = model(x, y)

# Print the shape of the output tensor
print(output.shape)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "alphafold3"
version = "0.0.1"
version = "0.0.2"
description = "Paper - Pytorch"
license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"]
Expand Down

0 comments on commit 9c7a47b

Please sign in to comment.