[PR #1140] [MERGED] fix: no need to clip input value of Sigmoid #1139

Closed
opened 2026-03-22 16:01:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1140
Author: @minhdang26403
Created: 1/26/2026
Status: Merged
Merged: 1/26/2026
Merged by: @profvjreddi

Base: devHead: fix/sigmoid


📝 Commits (1)

  • c4c3eee fix: no need to clip input value of Sigmoid

📊 Changes

1 file changed (+7 additions, -9 deletions)

View changed files

📝 tinytorch/src/02_activations/02_activations.py (+7 -9)

📄 Description

The code already handles overflow by splitting the input into positive and negative branches:

  • For x >= 0, computing e^(-x) will not result in overflow even though x is very large.
  • For x < 0, computing e^(x) will comfortably range between 0 and 1.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1140 **Author:** [@minhdang26403](https://github.com/minhdang26403) **Created:** 1/26/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/sigmoid` --- ### 📝 Commits (1) - [`c4c3eee`](https://github.com/harvard-edge/cs249r_book/commit/c4c3eee3a656b35e5901c85a722d1a401e4c3983) fix: no need to clip input value of Sigmoid ### 📊 Changes **1 file changed** (+7 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tinytorch/src/02_activations/02_activations.py` (+7 -9) </details> ### 📄 Description The code already handles overflow by splitting the input into positive and negative branches: - For x >= 0, computing e^(-x) will not result in overflow even though x is very large. - For x < 0, computing e^(x) will comfortably range between 0 and 1. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 16:01:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1139