Spontaneous sparse learning for PCM-based memristor neural networks