Measurement-driven neural-network training for integrated magnetic tunnel junction arrays