Codercise V.1.2.a Calculating gradients with PSR

Hello,
When I execute my code I get the error Error: parameter_shift_rule() missing 1 required positional argument: ‘theta’.
Given that I am not the one to call the function parameter_shift_rule() , which means i don’t choose the parameters. It is done by the code verifier. Could it be that the problem comes from the verifier ?

Thanks

Hi @yoshypdf ,

Is it possible that you might have removed theta from your function definition? It should look like this:

# Define the parameter-shift rule function
def parameter_shift_rule(theta):

Hi @yoshypdf, actually there was a bug which was fixed yesterday so it’s possible that your code from a few days ago now works. Let me know if you’re still having this issue!

Now it works, thanks

1 Like