# How I know the dim of the parameters of the w and b for initialization?

In course 1, week 2 assignment" Logistic Regression with a Neural Network mindset"
#Exercise 8 - model
how I know the dim of the parameters of the w and b for initialization?
I am using w, b = initialize_with_zeros(dim)

Hi malsharawy,

Welcome to the community and thanks for your question! Let me give you a hint: look at the arguments of the model function shown in red in your exercise. There you will see the different inputs for the function defined along with their shape. Think about which argument the w and b variables are using. If you know that, then you can determine the shape as well. Good luck and let us know whether you can find the answer!

Regards, Stephanus

1 Like

## Dear Stephanus, Thanks for your answer , i am not sure i got the right answer but it gives me now wrong values and wrong type for dw and db , here is the error

AssertionError Traceback (most recent call last)
in
----> 1 model_test(model)

~/work/release/W2A2/public_tests.py in model_test(target)
117 assert type(d[βwβ]) == np.ndarray, f"Wrong type for d[βwβ]. {type(d[βwβ])} != np.ndarray"
118 assert d[βwβ].shape == (X.shape[0], 1), f"Wrong shape for d[βwβ]. {d[βwβ].shape} != {(X.shape[0], 1)}"
β 119 assert np.allclose(d[βwβ], expected_output[βwβ]), f"Wrong values for d[βwβ]. {d[βwβ]} != {expected_output[βwβ]}"
120
121 assert np.allclose(d[βbβ], expected_output[βbβ]), f"Wrong values for d[βbβ]. {d[βbβ]} != {expected_output[βbβ]}"

AssertionError: Wrong values for d[βwβ]. [[ 0.28154433]
[-0.11519574]
[ 0.13142694]
[ 0.20526551]] != [[ 0.00194946]
[-0.0005046 ]
[ 0.00083111]
[ 0.00143207]]

can you give me a hint?

Hey got the same issue, check the func model parameters against the func optimize parameters.
You might want to review how you are calling the optimize function on model.

Thank you , IS THE X_train.shape = 4 in model ? as i understand it should be 12288

Hi, when `model_test(model)` is called `X_train.shape` is not 4, it is (4, 3), you can easily check it just by printing its shape inside the `model` function.

I donβt know if you have already solved the other errors but you could debug them just by comparing the expected output with the one you have, for example, starting with `d['w']`, that should be of type `np.ndarray`, so check whatβs the type of `w` anywhere you are using it, because thatβs basically what is assigned to `d['w']` in the dictionary `d`.

1 Like

it is solved thank you , i was having a typo error

Cool, keep the good work

Good to hear itβs solved!