notes for cost function for logistic regression