final tweak to EMA class

This commit is contained in:
Phil Wang
2022-05-16 11:54:34 -07:00
parent f4016f6302
commit 89ff04cfe2
2 changed files with 6 additions and 2 deletions

View File

@@ -195,7 +195,11 @@ class EMA(nn.Module):
def update(self): def update(self):
self.step += 1 self.step += 1
if self.step <= self.update_after_step or (self.step % self.update_every) != 0: if (self.step % self.update_every) != 0:
return
if self.step <= self.update_after_step:
self.copy_params_from_model_to_ema()
return return
if not self.initted: if not self.initted:

View File

@@ -10,7 +10,7 @@ setup(
'dream = dalle2_pytorch.cli:dream' 'dream = dalle2_pytorch.cli:dream'
], ],
}, },
version = '0.2.43', version = '0.2.44',
license='MIT', license='MIT',
description = 'DALL-E 2', description = 'DALL-E 2',
author = 'Phil Wang', author = 'Phil Wang',