Maybe this should be part of the nonlinearity class rather than the layer class. Do nonlinearities other than sigmoid even have a "classification" mode? We generally don't use rectifier as the final layer. We do use linear as the final layer, but then it is doing regression, not classification.