Skip to content
Snippets Groups Projects

Add backward functions for ReLU, Sigmoid and Tanh

Merged Olivier Antoni requested to merge (removed):dev into dev

Context

Add some backward functions that were missing.

Detailed modifications

  • Use a protype for backward function that may fit all the needs : input, output and grad_output are needed to compute grad_input in the general case (input was missing, output is kept to save computation). This may lead to unused parameters, but it is probably not an issue ?

  • Add missing backward functions for Sigmoid and Tanh.

  • Use input instead of output for testing the sign in ReLU (both codes should give same results, but the use of input is preferred).

TODO

For this merge request :

  • Fell free to adapt the proposed modifications to match code requirements.
  • Check if my understanding of the way the forward methods should work is correct.

For future :

  • Check the forward function for Sqrt operator that seems not to be correct.
  • Homogenize the way forward and backward are coded for all available operators.

Merge request reports

Merge request pipeline #47525 passed

Merge request pipeline passed for 1ab9eb04

Approval is optional

Merged by Olivier BICHLEROlivier BICHLER 10 months ago (Jun 10, 2024 8:49am UTC)

Merge details

  • Changes merged into with 3988b2f4.
  • Deleted the source branch.

Pipeline #47685 passed

Pipeline passed for 3988b2f4 on dev

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading