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

Added loss function and unit test for Poisson Loss #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yorozuya-2003
Copy link
Contributor

References to other Issues or PRs or Relevant literature

Fixes #9

Brief description of what is fixed or changed

  • Added class for Poisson Loss in \MLlib\loss_func.py
  • Added unit test corresponding to the same in \MLlib\tests\test_loss_func.py

Other comments

The unit test approximately compares the output of the implemented loss function with that of the corresponding loss function already there in TensorFlow when using the same test example as input.

@codecov
Copy link

codecov bot commented Dec 28, 2022

Codecov Report

Merging #211 (7bce8a5) into master (f43f6e7) will increase coverage by 2.39%.
The diff coverage is 83.33%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #211      +/-   ##
==========================================
+ Coverage   11.56%   13.96%   +2.39%     
==========================================
  Files          31       32       +1     
  Lines        2438     2456      +18     
==========================================
+ Hits          282      343      +61     
+ Misses       2156     2113      -43     
Flag Coverage Δ
unittests 13.96% <83.33%> (+2.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
MLlib/loss_func.py 44.53% <70.00%> (+44.53%) ⬆️
MLlib/tests/test_loss_func.py 100.00% <100.00%> (ø)

@rohansingh9001
Copy link
Collaborator

The loss method and the unit test looks good to me however it will not really be useful if you did not add a derivative method like the other loss classes in this file. Without a derivative function, the framework's models are unable to utilize loss classes.

Copy link
Collaborator

@rohansingh9001 rohansingh9001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The derivative function is missing from Poison loss class.

@yorozuya-2003
Copy link
Contributor Author

References to other Issues or PRs or Relevant literature

Fixes #9

Brief description of what is fixed or changed

  • Added derivative method for PoissonLoss class in \MLlib\loss_func.py

Other comments

I have tried adding the derivative method for the Poison loss class. Please suggest any corrections required. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more loss functions like cross-entropy...
2 participants