diffusion_models.utils.adopt

Module Contents

class ADOPT(params, lr=0.001, betas=(0.9, 0.9999), eps=1e-06, weight_decay=0.0, decoupled=False, *, foreach=None, maximize=False, capturable=False, differentiable=False, fused=None)[source]

Base class for all optimizers.

Warning

Parameters need to be specified as collections that have a deterministic ordering that is consistent between runs. Examples of objects that don’t satisfy those properties are sets and iterators over values of dictionaries.

Parameters:
  • params (iterable) – an iterable of torch.Tensor s or dict s. Specifies what Tensors should be optimized.

  • defaults – (dict): a dict containing default values of optimization options (used when a parameter group doesn’t specify them).

step(closure=None)[source]

Perform a single optimization step.

Parameters:

closure (Callable, optional) – A closure that reevaluates the model and returns the loss.

adopt(params, grads, exp_avgs, exp_avg_sqs, state_steps, foreach=None, capturable=False, differentiable=False, fused=None, grad_scale=None, found_inf=None, has_complex=False, *, beta1, beta2, lr, weight_decay, decoupled, eps, maximize)[source]

Functional API that performs ADOPT algorithm computation.