def _update_prototypes(self):
        """Update the prototypes based on the running averages."""
        for c, (p_sum, p_cnt) in self.tmp_p_mem.items():
            incr_p = normalize(p_sum / p_cnt, p=2, dim=1)  # L2 normalized
            old_p = self.p_mem[c].clone()
            new_p_momentum = (
                self.alpha * old_p + (1 - self.alpha) * incr_p
            )  # Momentum update
            self.p_mem[c] = normalize(new_p_momentum, p=2, dim=1).detach()
        self.tmp_p_mem = {}
Update the prototypes based on the running averages.
avalanche/training/plugins/cope.py