Skip to content

Fix ema decay#1868

Merged
patil-suraj merged 2 commits into
mainfrom
fix-ema-decay
Dec 30, 2022
Merged

Fix ema decay#1868
patil-suraj merged 2 commits into
mainfrom
fix-ema-decay

Conversation

@pcuenca

@pcuenca pcuenca commented Dec 30, 2022

Copy link
Copy Markdown
Member

Fixes #1864

@pcuenca pcuenca requested a review from patil-suraj December 30, 2022 11:15
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Dec 30, 2022

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

@patil-suraj patil-suraj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just left one nit. Thanks a lot, @jorgemcgomes for spotting the bug!

self.decay = self.get_decay(self.optimization_step)

# Compute the decay factor for the exponential moving average.
current_decay = (1 + self.optimization_step) / (10 + self.optimization_step)

@patil-suraj patil-suraj Dec 30, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) this is not the current decay, current decay is

min(decay, (1 + self.optimization_step) / (10 + self.optimization_step))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! I didn't like value because it doesn't mean anything, but will go back to it because can't think of anything better right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EMA model in Stable Diffusion training example is wrong

3 participants