MCPcopy Create free account
hub / github.com/pytorch/tutorials / update_exp_avg_sq

Function update_exp_avg_sq

recipes_source/foreach_map.py:87–88  ·  view source on GitHub ↗
(exp_avg_sq, grad, beta2)

Source from the content-addressed store, hash-verified

85
86# Functions to update the different optimizer states
87def update_exp_avg_sq(exp_avg_sq, grad, beta2):
88 return exp_avg_sq.mul(beta2).addcmul(grad, grad, value=1 - beta2)
89
90def update_param(param, step, exp_avg, exp_avg_sq, beta1, beta2, lr, eps):
91 bias_correction1 = 1 - torch.pow(beta1, step)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected