"Invalid value" in RMSprop implementation from scratch in Python
The regularization term (reg_term) is sometimes negative due negatative parameters. Hence S[f&quot;dW{l}&quot;] contains some negative values. I realize the reg_term has to be added before taking the sqrt, like this:
S[f&quot;dW{l}&quot;] = beta2 * S[f&quot;dW{l}&quot;] + (1 - beta2) * np.square(gradients[f&quot;dW{l}&quot;] + reg_term)