Finding the Optimal Network Depth in Classification Tasks