Hybrid In-memory Computing Architecture for the Training of Deep Neural Networks