Fast offset corrected in-memory training