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

Fixed Issue #20 [Feature Request] Add loss functions for classification tasks #30

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

arijitde92
Copy link
Contributor

Closes: #20

  • Title : Add loss functions for classification tasks
  • Name: Arijit De
  • Idenitfy yourself: SSoC'24 Contributor

Describe the add-ons or changes you've made 📃

Added implementations of hinge loss, KL Divergence loss and four versions of cross entropy loss from scratch using numpy.
The implementations also contains results with some sample data.
Also updated the README.md file inside ML directory with the links to the directories of the said loss functions.

Type of change ☑️

What sort of change have you made:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? ⚙️

It has been tested with sample data and the test code is also available in the respective loss function files.

Checklist: ☑️

  • My code follows the Contributing Guidelines & Code of Conduct of this project.
  • This PR does not contain plagiarized content.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • My changes generate no new warnings.

Screenshots 📷

Cross Entropy loss
CE_Loss

Hinge Loss
hinge_loss

KL-Divergence Loss
Screenshot 2024-06-11 185102

Note to reviewers 📄

…for classification tasks

Added hinge loss, KL Divergence loss and four versions of cross entropy loss

Signed-off-by: Arijit De <arijitde2050@gmail.com>
Copy link
Contributor

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

Copy link
Owner

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

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

@arijitde92 LGTM.

ML/Algorithms/Losses/HingeLoss/hinge_loss.py Show resolved Hide resolved
@Avdhesh-Varshney Avdhesh-Varshney added the question❓ Further information is requested label Jun 12, 2024
Copy link
Owner

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

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

@arijitde92 PR Approved 🎉

@Avdhesh-Varshney Avdhesh-Varshney merged commit be3ccfb into Avdhesh-Varshney:main Jun 14, 2024
1 check passed
@Avdhesh-Varshney Avdhesh-Varshney added Approved ✔️ This PR is approved by the PR or, Mentors SSOC These issue/pull request will be considered for SSOC'24 Intermediate Intermediate level issues/pull requests ML This comes under the `ML` directory and removed question❓ Further information is requested labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved ✔️ This PR is approved by the PR or, Mentors Intermediate Intermediate level issues/pull requests ML This comes under the `ML` directory SSOC These issue/pull request will be considered for SSOC'24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add loss functions for classification tasks
2 participants