DLS Week 2 cats assignment

GRADED FUNCTION: initialize_with_zeros

def initialize_with_zeros(dim):
“”"
This function creates a vector of zeros of shape (dim, 1) for w and initializes b to 0.

Argument:
dim -- size of the w vector we want (or number of parameters in this case)

Returns:
w -- initialized vector of shape (dim, 1)
b -- initialized scalar (corresponds to the bias) of type float
"""

# (≈ 2 lines of code)
# w = ...
# b = ...
# YOUR CODE STARTS HERE
w=(dim,1)
b=

# YOUR CODE ENDS HERE

return w, b

what will be in b and w im stuck there?

Hi @Fateh_Ali ,

The implementation instruction explained how to set w vector and the bias, b, to zero. Please refer to the start of Ex4 for that.

To set the w vector to zero, you will need the numpy function np.zeros(), passing in the dimensions, (dim, 1). To set b to zero under the datatype of float, you can do b = 0.0. The comment lines gave details of what the input arguments and the return parameters are.

I will come to you after trying this thanks.