antsnormflows.utils.optim

Functions

clear_grad(model)

Set gradients of model parameter to None as this speeds up training,

get_requires_grad_states(module)

Snapshots the current requires_grad flag of every parameter

restore_requires_grad(module, states)

Restores requires_grad flags previously captured with get_requires_grad_states

set_requires_grad(module, flag)

Sets requires_grad flag of all parameters of a torch.nn.module

update_lipschitz(model, n_iterations)