While computing Jcostfunction: "Runtime warning encountered in log"

By the way, this post talks about how we usually avoid np.log(0).