(self)
Resets optimizer state.
Resets optimizer state.
Resets optimizer state .
def reset_state(self):
        """Resets optimizer state."""
        for p in self.w.parameters():
            if 'velocity' in self.state[p]:
                self.state[p]['velocity'] = torch.zeros_like(p.data)
def reset_state ( self ) : for p in self . w . parameters ( ) : if 'velocity' in self . state [ p ] : self . state [ p ] [ 'velocity' ] = torch . zeros_like ( p . data )