Closed G0v1ndD3v closed 1 month ago
Dear @G0v1ndD3v,
Thank you for your contribution! I appreciate your hard work, and overall, your implementation looks excellent. However, I did notice a few minor issues that I would like to bring to your attention for refinement:
In model.py
: It would be more in line with common conventions to change the reference to .regularization
. This change will make the code more consistent with package standards.
In regularization.py
: Similarly, it would be better to modify to .device
for clarity and consistency.
I also attempted to run runner.py
for testing, but I encountered some issues during execution. It would be helpful if you could review the script to ensure everything is functioning as expected.
Once again, I appreciate your effort, and I look forward to your revisions. Please let me know if you need further clarification or assistance.
Updated the code to use .regularization
in model.py
and .device
in regularization.py
. Apologies for the oversight—I was used to working with an earlier version of the code that didn’t use relative imports and didn’t notice the switch.
Found my mistake in apply_l2_regularization
. I was dividing weights by X_shape
, which is a tuple (🤦), leading to a broadcasting error. Fixed it by dividing by X_shape[0]
. I tested it in runner.py
, and it's working fine now.
Thanks for pointing it out!
Keeping this PR as a draft for now; I still need to test with more datasets to cross-check. Will mark it ready once testing is complete.
Cool @G0v1ndD3v, keep going !
Hi @G0v1ndD3v,
I was facing this issue in your code.
But, I found the issue. Just change this line 77 X.shape
to X.shape[0]
(File: model.py
):
To:
And now it works:
Just change this and make a PR. You did an amazing work !
Oh, I thought I had patched that in a previous commit! Line 77 looks different in our versions—maybe you forgot to pull the latest changes?
Yes ! My bad. I didn't pull the latest changes. Thanks for letting me out ! I am merging this now ! Thank you @G0v1ndD3v !
This is my work so far on implementing L2 regularization and dropout options. Yet to be tested. Feedback is welcome!