Skip to content

docs: improve docstrings for Trainer, Checkpoint, concrete trainer#89

Open
mac-agent wants to merge 1 commit intopyfenn:mainfrom
mac-agent:docs/trainer-docstrings
Open

docs: improve docstrings for Trainer, Checkpoint, concrete trainer#89
mac-agent wants to merge 1 commit intopyfenn:mainfrom
mac-agent:docs/trainer-docstrings

Conversation

@mac-agent
Copy link
Copy Markdown
Contributor

Summary

Expands documentation for the trainer and checkpoint modules from minimal one-liners to full Google-style docstrings, addressing #88.

Changes

trainer.py:

  • Expanded Trainer class docstring with subclass references (ClassificationTrainer, RegressionTrainer, LoRATrainer)
  • Added detailed docstring for fit() explaining the validation/early stopping matrix
  • Improved predict() docstring
  • Added docstrings for _move_to_device() and _replace_state()
  • Enhanced _should_save_checkpoint(), load_checkpoint(), load_checkpoint_at_epoch(), load_best_checkpoint() with Args and Raises sections

checkpoint.py:

  • Expanded Checkpoint class docstring with usage example and detailed Args section

classification_trainer.py:

  • Rewrote class docstring to explain task type detection (binary/multiclass/multilabel) and per-mode behavior

regression_trainer.py:

  • Added class docstring explaining regression-specific metrics (R², MSE) and return_model parameter

Testing

No behavioral changes — these are documentation improvements only. 4 files changed, 161 insertions(-), 34 deletions(-).

…r classes \n\nExpand existing docstrings on the abstract Trainer class and the Checkpoint \nclass from minimal one-liners into full Google-style documentation. Improve \ntrainer.py, checkpoint.py, classification_trainer.py, regression_trainer.py \nwith detailed descriptions, Args sections, and usage examples.\n\nCloses pyfenn#88
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.

1 participant