When creating a post, please add:
- Week 2 module
- Graded Assignment: Getting syntax error
When creating a post, please add:
Please give us the entire error in the main body of the post!
Cell #UNQ_C2. Can’t compile the student’s code. Error: SyntaxError(‘invalid character in identifier’, (‘/tmp/student_solution_cells/cell_9.py’, 33, 7, ‘\xa0\xa0\xa0\xa0\xa0\xa0\xa0 f_wb = w*x[i]+b\n’))
UNQ_C2
GRADED FUNCTION: compute_gradient
mentor edit, code removed
I think there is indentation error in the code and there is logic error as well, we do summation of errors of weights and biases.
# mentor edit, code removed
Instead of accumulating the gradients, these lines overwrite the values of dj_dw_i
and dj_db_i
in each iteration. To correctly compute the total gradients, you should sum the individual contributions across all iterations.
Please do not post your code on the forum. That is not allowed by the Code of Conduct.