openfold.utils.exponential_moving_average

Classes

ExponentialMovingAverage(model, decay)

Maintains moving averages of parameters with exponential decay

class ExponentialMovingAverage(model, decay)

Maintains moving averages of parameters with exponential decay

At each step, the stored copy copy of each parameter param is updated as follows:

copy = decay * copy + (1 - decay) * param

where decay is an attribute of the ExponentialMovingAverage object.

Parameters:
load_state_dict(state_dict)
Parameters:

state_dict (OrderedDict)

Return type:

None

state_dict()
Return type:

OrderedDict

to(device)
update(model)

Updates the stored parameters using the state dict of the provided module. The module should have the same structure as that used to initialize the ExponentialMovingAverage object.

Parameters:

model (Module)

Return type:

None