Skip to content

feat(nn): [#220] add basic SLP classifier and regressor - #317

Open
NoumanParvez12 wants to merge 1 commit into
pyfenn:mainfrom
NoumanParvez12:feature
Open

feat(nn): [#220] add basic SLP classifier and regressor#317
NoumanParvez12 wants to merge 1 commit into
pyfenn:mainfrom
NoumanParvez12:feature

Conversation

@NoumanParvez12

Copy link
Copy Markdown

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

@NoumanParvez12

Copy link
Copy Markdown
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.
Let me know if you'd prefer a different file/class naming split, or if anything else should change before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add basic SingleLayerPerceptron Class

1 participant