implemented logistic regression output layer for deep nets