Biologically-inspired Learning in Pulsed Neural Networks