Assistance Needed with Regularization Programming Assignment - for Dropout part

Hi all,

I am encountering an issue with the dropout section of the regularization programming assignment. Specifically, the value of D1,D2 in my assignment differs from the value in the assertion code, despite both being generated using np.random.randn with a seed.

Given that D1,D2 is generated using a fixed seed, I expected the values to be consistent across different instances. However, this discrepancy is causing the assertion to fail.

I have attached the values of D1 and D2 from my assignment and the assertion code for your review.

D1 in my assignment:

[[False True True True False]
[ True False True True True]]

D1 in assertion:

[[ True, False, True, True, True],
[ True, True, True, True, True]]

D2 in my assignment

[[False True True True False]
[ True True True True True]
[ True False False True False]]

D2 in assertion

[[ True, True, True, False, True],
[ True, True, True, True, True],
[False, False, True, True, False]]

code sample -

{mentor edit: code removed}

Please move your thread to the forum area for your course.

You can do this using the “pencil” icon in the thread title.

Select the “Course Q&A” forum then select your course topic, then add a tag for the week number.

1 Like

Check the instruction again. It should not be np.random.randn().

2 Likes

Posting solution code in a public topic goes against our Community Forum Code of Conduct. It’s okay to share stacktrace on a public post.

If a mentor needs to see your code, we’ll contact you with instructions.

I have edited your post.

1 Like