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

Adding the SoftMax Function #469

Merged

Conversation

RicardoRibeiroRodrigues
Copy link
Contributor

@RicardoRibeiroRodrigues RicardoRibeiroRodrigues commented Aug 27, 2024

Summary of change

This pull request introduces an implementation of the SoftMax algorithm. The SoftMax function is often used as the last activation function of a neural network to normalize the output of a network to a probability distribution over predicted output classes.

Definition

The SoftMax function takes as input a vector z of K real numbers, and normalizes it into a probability distribution consisting of K probabilities proportional to the exponentials of the input numbers.

Motivation

The SoftMax function is a critical component in many machine learning models, particularly in classification tasks within neural networks.

Time Complexity

The time complexity for the SoftMax algorithm is O(n), where n is the number of elements in the input array.

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.99%. Comparing base (cb45f4a) to head (62ac483).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #469      +/-   ##
==========================================
- Coverage   95.00%   94.99%   -0.02%     
==========================================
  Files         238      239       +1     
  Lines       10091    10108      +17     
  Branches     1429     1432       +3     
==========================================
+ Hits         9587     9602      +15     
  Misses        389      389              
- Partials      115      117       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 5c09c0e into TheAlgorithms:master Aug 27, 2024
3 of 4 checks passed
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.

2 participants