HW 3: Stuck on first question

link removed as sharing any codes, notebook links is against community guidelines
Hi there,
i was able to do the week 1 and week 2 relatively easily, but I am stuck on week 3’s programming assignment for a long time, on the very first question.
And I am not sure if it is testing for the right values:

E.g., its output is hardcoded to the following values, while the method get_sub_volume is randomly generating the output values:

    expected_output = (np.array([[[[1., 2.],
                                   [2., 4.]],
                                  [[2., 4.],
                                   [4., 8.]]]]), 
                       np.array([[[[1., 0.],
                                   [1., 0.]],
                                  [[1., 0.],
                                   [1., 0.]]],
                                 [[[0., 1.],
                                   [0., 1.]],
                                  [[0., 1.],
                                   [0., 1.]]]], dtype=np.float32))

This expected output will only work if the randomly chosen values inside the function (start_x, start_y, and start_z) are equal to 1,1,1
The test passed, when I hard coded the above 3 variables as follows

        start_x = 1
        start_y = 1
        start_z = 1

hi @khichi

please refer below link comment on how to get fresh copy

but there seems to be currently some issue with coursera environment, so try after sometime

Thanks @Deepti_Prasad

I have refreshed my online notebook. The test still fails.

Meanwhile, I have also downloaded the selective piece of code to run it locally. I am still perplexed that the test get_sub_volume_test(get_sub_volume) passes when I hard code the following values. (otherwise the test fails when using random values here):

        start_x = 1
        start_y = 1
        start_z = 1

So I wonder if the test is actually testing for the right thing? (or more likely, i have a gap in my understanding, in which case, can someone help with that?)

please share screenshot of the code by personal DM. Click on my name and then message.

@khichi if you see the below pinned comment, you will see how the grade cell looks when you get a fesh copy of assignment.

you seem to have edited parts of codes which you are not suppose to.

when you next get a fresh copy of assignment, make sure just to replace the None with correct codes placed between the markers ###START AND END CODE HERE###

do not add any import statement in grade cell codes.

Also amke sure to read the comment in the same post for change in dimension codes as that is the usual point of mistake by most learners.

In the one hot encode the categories, num_classes=num_classes should be used, rather than what you have used.

Let me know if you need any help further, or send me how you did correction after this(make sure to send codes only by personal DM and not post here)

Regards
DP

1 Like

Thanks @Deepti_Prasad
That solved my issue.

1 Like