Gradients of unitary optical neural networks using parameter-shift rule