Self-recovery of memory via generative replay