This code from lab Logistic_Regression_with_a_Neural_Network_mindset week 2
{moderator edit: code removed}
What do you mean exactly by “count with dots”?
Please don’t post your code on the forum, that breaks the code of conduct.
ok, we can delete it after resolving of problem. I wrote correct code. But there is note in comment, that I could do it through .dot. So, it is interesting for me how to do it. You can see attempt to do it in comments, but it says that arrays has not matching dimentions.
Just as you used a transpose in computing the sigmoid, you may also need a transpose to compute the cost using a dot product.
You can print the shapes of the variables to get an idea where you may need a transposition (or change the order of the arguments) to get the correct result.
Can you give me ready solution with using of dot, mate? I don’t have idea how to do
No, the mentors won’t write the code for you.
my choice is working? Have you understood? I only want to understand how would work alternative option with dots. How can I know how it should work without example?
If you have a matrix A and a vector w, you can compute their dot product by:
result = np.dot(A, w)
The shape of A must be (m, n), and the shape of w must be (1, n).
Documentation and examples are here:
https://numpy.org/doc/stable/reference/generated/numpy.dot.html
I know what is dot, I can’t understand how to apply to my example
Tom also shows you how to apply the dot
to any example.