Deep learning incorporating biologically inspired neural dynamics and in-memory computing