Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/diffusers/training_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -341,9 +341,6 @@ def __init__(
)
parameters = parameters.parameters()

# set use_ema_warmup to True if a torch.nn.Module is passed for backwards compatibility
use_ema_warmup = True

if kwargs.get("max_value", None) is not None:
deprecation_message = "The `max_value` argument is deprecated. Please use `decay` instead."
deprecate("max_value", "1.0.0", deprecation_message, standard_warn=False)
Expand DownExpand Up@@ -414,7 +411,7 @@ def get_decay(self, optimization_step: int) -> float:
if self.use_ema_warmup:
cur_decay_value = 1 - (1 + step / self.inv_gamma) ** -self.power
else:
cur_decay_value = (1 + step) / (10 + step)
cur_decay_value = self.decay

cur_decay_value = min(cur_decay_value, self.decay)
# make sure decay is not smaller than min_decay
Expand Down