Skip to content
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

ML01 ex03: Wrong loss_elem_ examples #235

Open
2 tasks
mli42 opened this issue Aug 22, 2022 · 0 comments
Open
2 tasks

ML01 ex03: Wrong loss_elem_ examples #235

mli42 opened this issue Aug 22, 2022 · 0 comments
Labels

Comments

@mli42
Copy link

mli42 commented Aug 22, 2022

  • Day: 06
  • Exercise: 03

Given examples of loss_elem_ are 10 times greater than it should.
The subject says:

# Example 0.1:
lr1.loss_elem_(y, y_hat)
# Output:
array([[710.45867381],
[364.68645485],
[469.96221651],
[108.97553412],
[299.37111101]])

But the loss is "only" at 195...

# Example 0.2:
lr1.loss_(y, y_hat)
# Output:
195.34539903032385

With my code, I got this for loss_elem_ and I have the right loss_:

array([[71.04586738],
[36.46864549],
[46.99622165],
[10.89755341],
[29.9371111 ]])

The same issue is repeted for lr2, subject loss_elem_:

# Example 1.2:
lr2.loss_elem_(y, y_hat)
# Output:
array([[486.66604863],
[115.88278416],
[ 84.16711596],
[ 85.96919719],
[ 35.71448348]])

Subject loss:

# Example 1.3:
lr2.loss_(y, y_hat)
# Output:
80.83996294128525

My code:

array([[48.66660486],
[11.58827842],
[ 8.4167116 ],
[ 8.59691972],
[ 3.57144835]])

Fixed on:

  • Github
  • Gitlab
@mli42 mli42 added the fixme label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant