Test check says im wrong when im not

I created the below code. I think it’s right. You can see I get the output expected. But somehow the test-check wants some other data.

What do I do?

First, you cannot post code solutions publicly so please remove the code part.

Second, are you perhaps hardcoding the parameters dictionary that I see in here?

Do not set the “parameters” variable within the function. Use the value that is in
the parameter list.

Thanks, I removed it.
I did, however those were other values than the ones I wanted, because they were randomly generated I assume. I will try again.

I tried some other solutions. Where do I find the parameters without hard coding them?

The parameter values are learned during training.

That is the entire purpose of machine learning - to learn the weights that give the lowest cost.

How would I do this?

My initial parameters in the code block above were:
W = [[-0.01185047]]
b = [[0.]]

How do I use them without hard-coding them, in the next block?

If you’re talking about the initialize_parameters() function, the instructions are here:

The test that your code is failing is this one:
image

The w3_unittest() function provides its own parameter values.

Do not hard-code any of the parameter values, except via the initialize_parameters() function.

1 Like

So I found the errors. I previously did not use np.dot() when multiplying weight and X. That was the error. I also instead of hard coding the weight and bias just took them from the previous list created.

That’s good news!