Update Parameters in Building NN Step-by-Step Lab

You are correct that a deep copy is necessary there. Either that or you just need not to use the -= “in place” operator, in which case no copy would be necessary.

Here’s a thread which discusses these points in more detail, but it sounds like you probably already understand the points being mentioned there if you figured out the “deepcopy” solution.

I’ll file a suggestion with the course staff that they should change the template code for that function.

1 Like