Spike-Based Compared to Rate-Based Hebbian Learning