feat(nn): [#220] add basic SLP classifier and regressor - #317
Open
NoumanParvez12 wants to merge 1 commit into
Open
feat(nn): [#220] add basic SLP classifier and regressor#317NoumanParvez12 wants to merge 1 commit into
NoumanParvez12 wants to merge 1 commit into
Conversation
Author
|
@blkdmr This is ready for review. A couple of notes: Since sklearn.linear_model.Perceptron uses penalty/alpha/eta0-style params but our Trainer classes are built around a PyTorch optimizer, I kept solver/learning_rate_init (matching MLPClassifier's pattern) rather than mirroring sklearn's exact param names. Happy to adjust if you'd rather match sklearn more closely. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements SLPClassifier and SLPRegressor in fenn/nn/models/slp.py, following the structure of MLPClassifier/MLPRegressor in mlp.py, as discussed with @blkdmr on the issue.
Mirrors sklearn.linear_model.Perceptron's API for classification; regression (SLPRegressor) follows the same pattern since sklearn has no direct equivalent for regression.
Delegates all training to the existing ClassificationTrainer/RegressionTrainer — no training logic added, per issue requirements.
Naming follows maintainer guidance (SLP prefix, not the full "SingleLayerPerceptron" name)
_build_slp builds a single nn.Linear layer with no hidden layers/activation, unlike _build_mlp
Added tests/unit/nn/test_slp.py, mirroring test_mlp.py's structure — all tests pass, full existing suite (936 tests) still passes.
Closes #220