Why the cost/loss starts to increase for some iterations during the training phase?
In general, there's nothing wrong with training loss to increase from time-to-time during training.
This is because GD with minibatch is a stochastic process and doesn't guarantee that the loss will decrease at each step.