After a while puzzling at it, I was able to see that these notations included the derivative of a sigmoid and a tanh function. I think that adding the sigmoid_derivative and tanh_derivative function to the code makes it more clear for the viewer what is happening at that location (so I did exactly that). It is also consistent with the fact that there is a separate sigmoid function.
I struggled for a while understanding this part of the code:
After a while puzzling at it, I was able to see that these notations included the derivative of a sigmoid and a tanh function. I think that adding the sigmoid_derivative and tanh_derivative function to the code makes it more clear for the viewer what is happening at that location (so I did exactly that). It is also consistent with the fact that there is a separate sigmoid function.