Wee1 5 - Backpropagation in Convolutional Neural Networks (OPTIONAL / UNGRADED) should not be graded, but seems graded

I submit the assignment with errors only in the section of optional part, 5 - Backpropagation in Convolutional Neural Networks (OPTIONAL / UNGRADED)

But I think this optional part seems graded resulting in fail of assignment.

Is it mandatory?
If so please correct title, if it is optional please allow me to pass.

The optional part is evaluated, but it doesn’t score any points.

Did the errors make the grader crash?

Yes, I can’t pass even though there is no error and passed assertions for all mandatory part.
Please check.

Please post a screen capture image showing the “grader output”.

Passing all of the assertions does not prove your code is perfect.


Is this OK?

{mentor edit: code removed}
This is what I submitted.

You got 50 points and failed tests on two cells. So no, that’s not OK.

Which one I failed?
I think I failed on operational part.

How can I find the failed part?
I don’t see any problem in mandatory part.

I do not know if these will fix the problems, but here are some suggestions from reviewing your notebook:

  • In conv_single_step(), use np.float64(). (error corrected, used to say float32() but that’s wrong).
  • In conf_forward(), your slicing of A_prev_pad may not be correct. Use [i, :, :, :]. And you must include the “stride” in computing vert_start and horiz_start. Otherwise your code only works if stride = 1.
  • In pool_forward(), you have the same problem with using the “stride” variable.

I did not review your conv backward code, because it is not graded.

  1. List item

Hi I updated according your suggestion.
But I can’t pass yet.
What other parts I should change?
Isn’t optional part really included?

{mentor edit: code removed}

The optional part does not have to pass any tests. But it does have to not make the grader crash due to syntax errors or other asserts.

Try commenting out the code you added for the optional parts, then you should be able to get 100/100 by working on only the required code.

Then you can add the optional parts again later.

I already commented out, but the result is the same.
You can check my commented out code in the previously attached file.

In np.pad() do not set the mode or constant_values arguments.
In conv_single_step(), the instructions say to use float(), not float64().

In conv_forward() and pool_forward(), do not use “stride” in the range() function. When stride=2 as the increment in range(), it skips over half of the input values. That’s why your code fails the grader. The unit test in the notebook does not detect this error.

“stride” should be used as a multiplier when computing vert_start and horiz_start.

In the future, please do not share your code unless a mentor specifically asks to see it.

Regarding float, I used float in my initial implementation, but you suggested np.float32(), but it caused error, so I used np.float64 instead. Why did you suggest np.float32() if my original code was correct.

Now I got 75 score, what else I should change?

I made a mistake, sorry. The instruction text is trying to get you to use np.float(). Other discussion threads say you can also use np.float64().

I used exactly your code:

    s = a_slice_prev * W
    Z = s.sum()
    Z = Z + np.float64(b)

And it passed the grader. So it appears the problem is elsewhere.

The most common error in this assignment is with using the “stride” variable correctly.

(Updated to correct some errors)

I checked the notebook you most recently posted.

There is a duplicate cell that defines a second copy of the conv_backward() function.

I suggested that you delete the additional cell, and delete the cell you added that has the comment about the dA_prev error.

Adding cells to the notebook is a bad idea - it can confuse the grader.

======
From your previous notebook, I made these changes:

  • Used np.float64().
  • Fixed the problems with using stride in conv_forward()
  • Fixed the problems with using stride in pool_forward()

The code passed the grader 100/100.

I deleted the added cell and cleared the output of evaluation cell, but the result is still 75. I cannot delete the evaluation cell. I think I don’t have that permission.

What “evaluation cell” are you talking about? Post a screen capture image of that cell.

In addition to the changes I mentioned, I also deleted the cell with the duplicate function definition, and the cell that had only your added comment.

I am talking about this one, nothing happened when I clicked scissor button.
But I cleared output, so there is no error when I submitted the code.