Text this: Gradient method for designing cascaded DOEs and its application in the problem of classifying handwritten digits