Optimization-based Block Coordinate Gradient Coding for Mitigating Partial Stragglers in Distributed Learning