ex2-2 logistic costFunction done