There is a problem comes to me when computing the cost :
File “”, line 25
cost_sum = 0
^
IndentationError: unindent does not match any outer indentation level
And when i check if my implementation is right it tell me this:
NameError Traceback (most recent call last)
in
3 initial_b = 1
4
----> 5 cost = compute_cost(x_train, y_train, initial_w, initial_b)
6 print(type(cost))
7 print(f’Cost at initial w: {cost:.3f}')
The "indentationerror: unindent does not match any outer indentation level” error is raised when you use both spaces and tabs to indent your code. To solve this error, check to make sure that all your code uses either spaces or tabs in a program
On solving this issue in compute_cost function your next error should be resolved if your code is perfect
However, the “compute_cost not defined” error could simply be because you opened the notebook but didn’t run all of the initial cells that define the workspace.