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

Feature Addition: PRelu Module #1328

Merged
merged 7 commits into from
Feb 24, 2024
Merged

Conversation

Arjun31415
Copy link
Contributor

@Arjun31415 Arjun31415 commented Feb 19, 2024

Addtion of PRelu Activation Layer

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

Provide links to relevant issues and dependent PRs.

Changes

Summarize the problem being addressed and your solution.

Testing

  • Tested on 2D data
  • tested for positive, negative and 0 as weight param
  • tested forward pass

@Arjun31415 Arjun31415 marked this pull request as draft February 19, 2024 15:16
@Arjun31415 Arjun31415 marked this pull request as ready for review February 20, 2024 05:40
@Arjun31415
Copy link
Contributor Author

Arjun31415 commented Feb 20, 2024

Adding docs to the book is pending.
Tests are also missing

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 91.03448% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 84.51%. Comparing base (bff4961) to head (c24c94f).
Report is 3 commits behind head on main.

Files Patch % Lines
crates/burn-core/src/nn/prelu.rs 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1328      +/-   ##
==========================================
+ Coverage   78.87%   84.51%   +5.64%     
==========================================
  Files         555      583      +28     
  Lines       62176    64908    +2732     
==========================================
+ Hits        49040    54858    +5818     
+ Misses      13136    10050    -3086     

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

@Arjun31415
Copy link
Contributor Author

Arjun31415 commented Feb 20, 2024

I believe I'm doing the reshape and broadcast wrongly also. Need to check that too.
Edit: Fixed

@Arjun31415 Arjun31415 marked this pull request as draft February 20, 2024 08:48
@Arjun31415 Arjun31415 marked this pull request as ready for review February 20, 2024 14:30
Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

Just a quick note. Can we also update the burn-books in these sections with your new activation function and module?

  1. https://burn.dev/book/building-blocks/tensor.html#activation-functions
  2. https://burn.dev/book/building-blocks/module.html#built-in-modules

@Arjun31415
Copy link
Contributor Author

Sure I will add the book section If my implementation is correct

@Arjun31415
Copy link
Contributor Author

I think I resolved all the merge conflicts now

Copy link
Member

@nathanielsimard nathanielsimard left a comment

Choose a reason for hiding this comment

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

Good job, that's a nice addition, I have some comments, but I don't think they are going to be hard to resolve.

crates/burn-core/src/nn/prelu.rs Outdated Show resolved Hide resolved
crates/burn-tensor/src/tensor/activation/base.rs Outdated Show resolved Hide resolved
crates/burn-tensor/src/tensor/ops/activation.rs Outdated Show resolved Hide resolved
crates/burn-tensor/src/tests/activation/prelu.rs Outdated Show resolved Hide resolved
@Arjun31415
Copy link
Contributor Author

Arjun31415 commented Feb 22, 2024

I don't understand how the coverage is decreasing for test function
https://app.codecov.io/gh/tracel-ai/burn/pull/1328/blob/crates/burn-tensor/src/tests/activation/prelu.rs.

Do I need to add tests for prelu layer in burn-core crate?

@antimora
Copy link
Collaborator

I don't understand how the coverage is decreasing for test function https://app.codecov.io/gh/tracel-ai/burn/pull/1328/blob/crates/burn-tensor/src/tests/activation/prelu.rs

@Arjun31415 , Missing #[test] above the function?

@Arjun31415
Copy link
Contributor Author

I don't understand how the coverage is decreasing for test function https://app.codecov.io/gh/tracel-ai/burn/pull/1328/blob/crates/burn-tensor/src/tests/activation/prelu.rs

@Arjun31415 , Missing #[test] above the function?

yeah that was silly of me

fixed bugs in Forward function
refactor tests
@Arjun31415
Copy link
Contributor Author

Just a quick note. Can we also update the burn-books in these sections with your new activation function and module?

1. https://burn.dev/book/building-blocks/tensor.html#activation-functions

2. https://burn.dev/book/building-blocks/module.html#built-in-modules

Added docs

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

LGTM from my end. Just take care of Nathaniel's comments.

@Arjun31415
Copy link
Contributor Author

@nathanielsimard please check. I have made the changes as requested

@nathanielsimard nathanielsimard merged commit 8e23057 into tracel-ai:main Feb 24, 2024
14 checks passed
@Arjun31415 Arjun31415 deleted the prelu branch February 24, 2024 15:34
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.

3 participants