Similarity-based context aware continual learning for spiking neural networks