Why is there a Loop over "n" in the final coursework but not during the same exercise in W3?

final coursework on the right , exercise midweek on the left
image removed by moderator as it contained grade function codes posting which is a direct violation of Code of Conduct.

@Mutasem

the z_i in lab5 is calculating the same as the one in loop over m example in the course assignment lab. it just two different ways of code implementation to calculate cost where one is

Also kindly remove your image as you have posted grade function codes which is direct violation of Code of Conduct.

Regards
DP

thanks Deepti. If it is the same, why is n=1 and there is a new line for z_wb_ij?

Btw I can’t delete the post for some reason (Deeplearning won’t allow me). The grade function codes are in the “Click for hints” part.

i haven’t had access to the course for long, but as far as I remember that section only mention total cost as 0. Also remember n is number of feature, so selecting n as 1 shouldn’t be issue.

Don’t worry for this time I am removing your image but be careful from next time when you create a topic.

if there are any grade code related issue, you can only share a screenshot of the error, your output with expected output. if a mentor wants to look at your codes or wants to discuss about codes, it is usually done through DMs.

Regards
DP

1 Like

ok good to know, thanks again :smiley:

1 Like

one thing to note is that a lot of the assignments use loops to help you unpack the summations over different dimensions (features, examples etc.) but I personally find the matrix math representation to be much simpler and more intuitive

so for example f = X @ w + b instead of looping over each Xi and Wi seems more intuitive to me. Once you get comfortable with matrix notations then similarly thinking of z as sigmoid(X @ w + b) is simpler than trying to break everything down into loops.

2 Likes

I agree. Matrix algebra is much simpler to implement than a lot of nested for-loops.