It seems you are dividing by zero while trying to reset the parameters.
Did you write reset_parameters yourself or have you used some other implementation?
Could you post a code snippet to reproduce this issue?