Logistic Regrassion: Computing the cost function J(θ).