-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #1
base: master
Are you sure you want to change the base?
Conversation
@@ -853,19 +971,25 @@ | |||
" \"\"\"\n", | |||
" \n", | |||
" ### START CODE HERE ### (≈ 1 line of code)\n", | |||
" loss = None\n", | |||
" loss = np.sum(abs(y-yhat))\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно тут лучше явно обращаться к функциям numpy
loss = np.sum(np.abs(y-yhat))
потому что "Explicit is better than implicit" https://www.python.org/dev/peps/pep-0020/#id3
Хотя этот код тоже будет правильно работать
https://stackoverflow.com/questions/20953127/why-built-in-functions-like-abs-works-on-numpy-array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Внес правки и добавил np.abs
Никогда не задумывался, какая разница между np.abs и abs ...
"\n", | ||
" # Gradient descent (≈ 1 line of code)\n", | ||
" parameters, grads, costs = None\n", | ||
" parameters, grads, costs = optimize(w, b, X_train, Y_train, num_iterations, learning_rate, print_cost = False)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен с замечанием, добавил необходимые правки в "model"
great! |
Realization: