Skip to content

Commit f939345

Browse files
committed
add shrink and perturb fn
1 parent 8d81691 commit f939345

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,15 @@ docker run -v .:/data --gpus all -it af3
438438
year = {2023}
439439
}
440440
```
441+
442+
```bibtex
443+
@article{Ash2019OnTD,
444+
title = {On the Difficulty of Warm-Starting Neural Network Training},
445+
author = {Jordan T. Ash and Ryan P. Adams},
446+
journal = {ArXiv},
447+
year = {2019},
448+
volume = {abs/1910.08475},
449+
url = {https://api.semanticscholar.org/CorpusID:204788802}
450+
}
451+
```
452+

alphafold3_pytorch/alphafold3.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5415,6 +5415,20 @@ def init_and_load(
54155415
alphafold3.load(path)
54165416
return alphafold3
54175417

5418+
def shrink_and_perturb_(
5419+
self,
5420+
shrink_factor = 0.5,
5421+
perturb_factor = 0.01
5422+
):
5423+
# Shrink & Perturb - Ash et al. https://arxiv.org/abs/1910.08475
5424+
assert 0. <= shrink_factor <= 1.
5425+
5426+
for p in self.parameters():
5427+
noise = torch.randn_like(p.data)
5428+
p.data.mul_(1. - shrink_factor).add_(noise * 0.1)
5429+
5430+
return self
5431+
54185432
@typecheck
54195433
def forward(
54205434
self,

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.4.10"
3+
version = "0.4.11"
44
description = "Alphafold 3 - Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" },

0 commit comments

Comments
 (0)