In steps 1 and 2, we minimize the size and the number of convolutional layers while in the last step, we minimize the fully-connected layer. Thus, in steps 1 and 2, we minimize the running time of the CNN while in the last step, we minimize its memory requirements.