[ENH] refactor _loss_mapping to tags of metrics, entirely#2327
[ENH] refactor _loss_mapping to tags of metrics, entirely#2327Faakhir30 wants to merge 8 commits into
Conversation
|
Edit: Done, ready for revview |
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2327 +/- ##
=======================================
Coverage ? 87.53%
=======================================
Files ? 166
Lines ? 9767
Branches ? 0
=======================================
Hits ? 8550
Misses ? 1217
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| for loss_pkg in compatible_loss_pkgs: | ||
| loss = loss_pkg.get_cls()() | ||
| loss_name = loss.__class__.__name__ | ||
| loss_params = deepcopy(loss_pkg.get_default_params()) |
There was a problem hiding this comment.
should we add a way to pass some other "params" to losses here?
I think that would make it overcomplicated no?
What do you think @Faakhir30 @fkiraly ?
There was a problem hiding this comment.
I think a solution will be to have some method that has dict of losses: loss_kwargs at model pkg level and testing framework override for that particular model+loss combination.
Currently I'm unable to see any such case, we can add it later if any such case arrive.
phoeenniixx
left a comment
There was a problem hiding this comment.
Nice!
I think it is ready! Just a small doubt and a suggestion (see above)
Please add docstrings to all public methods atleast - to prevent any confusions on what the methods do!
Signed-off-by: Faakhir30 <zahidfaakhir@gmail.com>
Reference Issues/PRs
Closes #1957
What does this implement/fix? Explain your changes.
_loss_mapping.pyto tagsall_objectsof typemetricand specificmetric_typebased onpred_typeandy_typeget_test_train_paramsfor thisPR checklist
pre-commit install.To run hooks independent of commit, execute
pre-commit run --all-files