Spiking neural networks with Hebbian plasticity for unsupervised representation learning