Max-affine regression via first-order methods