Magnetic tunnel junction based implementation of spike time dependent plasticity learning for pattern recognition