Almost done with calculating cost of the neural network