Module 09 - Minor Computation Error #490

Closed
opened 2026-03-22 15:43:25 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @ngbolin on GitHub (Jan 27, 2026).

Hello, there seems to be a minor computation error for module 09 in one of the examples - attaching the screenshot for reference.

I think the (2, 2) element of the Position (1, 1) should be 7 instead of 8, since we are just taking the trace.

Image
Originally created by @ngbolin on GitHub (Jan 27, 2026). Hello, there seems to be a minor computation error for module 09 in one of the examples - attaching the screenshot for reference. I think the (2, 2) element of the Position (1, 1) should be 7 instead of 8, since we are just taking the trace. <img width="542" height="511" alt="Image" src="https://github.com/user-attachments/assets/6d0919b8-3473-42f9-9a08-9597c0bbcf27" />
GiteaMirror added the type: errataarea: tinytorch labels 2026-03-22 15:43:25 -05:00
Author
Owner

@profvjreddi commented on GitHub (Jan 27, 2026):

Thanks for catching this @ngbolin! You're absolutely right.

The fix: Position (1,1) with region 6,7],[0,1 and kernel 1,0],[0,1 correctly computes to:

6×1 + 7×0 + 0×0 + 1×1 = 6 + 0 + 0 + 1 = 7

I just corrected this in the convolution module. The final output is also updated now -- correctly shown as 7,9],[5,7.

Image

Fix merged into dev: https://github.com/harvard-edge/cs249r_book/commit/77baa56d2

@all-contributors please add @ngbolin for ✍️ Doc in Tinytorch

@profvjreddi commented on GitHub (Jan 27, 2026): Thanks for catching this @ngbolin! You're absolutely right. The fix: Position (1,1) with region [[6,7],[0,1]] and kernel [[1,0],[0,1]] correctly computes to: `6×1 + 7×0 + 0×0 + 1×1 = 6 + 0 + 0 + 1 = 7` I just corrected this in the convolution module. The final output is also updated now -- correctly shown as [[7,9],[5,7]]. <img width="894" height="1056" alt="Image" src="https://github.com/user-attachments/assets/a30a79f1-570b-4ee9-aa33-b7c43c107ac1" /> Fix merged into dev: https://github.com/harvard-edge/cs249r_book/commit/77baa56d2 @all-contributors please add @ngbolin for ✍️ Doc in Tinytorch
Author
Owner

@profvjreddi commented on GitHub (Jan 27, 2026):

I will release a version later today for v.0.1.5 which has a ton of bug fixes (esp. in pytest 😓 )

@profvjreddi commented on GitHub (Jan 27, 2026): I will release a version later today for v.0.1.5 which has a ton of bug fixes (esp. in pytest 😓 )
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2026):

I've added @ngbolin as a contributor to book! 🎉

Recognized for: doc
Based on: @all-contributors please add @ngbolin for ✍️ Doc in Tinytorch

The contributor list has been updated in:

  • book/.all-contributorsrc
  • book/README.md
  • Main README.md

We love recognizing our contributors! ❤️

@github-actions[bot] commented on GitHub (Jan 27, 2026): I've added @ngbolin as a contributor to **book**! :tada: **Recognized for:** doc **Based on:** @all-contributors please add @ngbolin for ✍️ Doc in Tinytorch The contributor list has been updated in: - `book/.all-contributorsrc` - `book/README.md` - Main `README.md` We love recognizing our contributors! :heart:
Author
Owner

@ngbolin commented on GitHub (Jan 27, 2026):

Hi @profvjreddi, there are a few (very minor) errors in module 09:

  1. There are 7 loops instead of 6, if we were to include the input channel (for filters) when applying Conv2D.
  2. As there are only 2 pool layers (with kernel size 2, stride 2), the 32x32 input is reduced to a 8x8 output (instead of 4x4 output) under SimpleCNN.

Thank you!

Image Image
@ngbolin commented on GitHub (Jan 27, 2026): Hi @profvjreddi, there are a few (very minor) errors in module 09: 1. There are 7 loops instead of 6, if we were to include the input channel (for filters) when applying Conv2D. 2. As there are only 2 pool layers (with kernel size 2, stride 2), the 32x32 input is reduced to a 8x8 output (instead of 4x4 output) under SimpleCNN. Thank you! <img width="648" height="292" alt="Image" src="https://github.com/user-attachments/assets/12ac2af6-fddb-40bd-9cce-02aab3d765c6" /> <img width="495" height="191" alt="Image" src="https://github.com/user-attachments/assets/778ffed5-3d39-406b-99f7-bfe99eec5efe" />
Author
Owner

@profvjreddi commented on GitHub (Jan 27, 2026):

You are two steps ahead of me! I love it!!! 🎉

After you caught the other ones, I found these and already fixed them. The corrections have been pushed to dev and are included in the tinytorch-v0.1.5 release.

Thanks again for your sharp eye! 👀

@profvjreddi commented on GitHub (Jan 27, 2026): You are two steps ahead of me! I love it!!! 🎉 After you caught the other ones, I found these and already fixed them. The corrections have been pushed to `dev` and are included in the [tinytorch-v0.1.5 release](https://github.com/harvard-edge/cs249r_book/releases/tag/tinytorch-v0.1.5). Thanks again for your sharp eye! 👀
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#490