Skip to content

Commit

Permalink
every machine keep track of ema if using switch ema
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Oct 17, 2024
1 parent 39d282f commit 3415855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion alphafold3_pytorch/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,14 @@ def __init__(
self.distributed_eval = distributed_eval
self.will_eval_or_test = self.is_main or distributed_eval

# using "switch" ema

self.switch_ema = exists(ema_update_model_with_ema_every)

# exponential moving average

self.ema_model = None
self.has_ema = self.will_eval_or_test and use_ema
self.has_ema = (self.will_eval_or_test or self.switch_ema) and use_ema

if self.has_ema:
self.ema_model = EMA(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "alphafold3-pytorch"
version = "0.6.3"
version = "0.6.4"
description = "Alphafold 3 - Pytorch"
authors = [
{ name = "Phil Wang", email = "[email protected]" },
Expand Down

0 comments on commit 3415855

Please sign in to comment.