-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Motivation
As a new user learning PyTorch Lightning, I was surprised at the naming inconsistency between the validation_step() and val_dataloader() hooks. Searching through the codebase, it seems that most methods or getters/setters favor "validation"...
validation_step_endvalidation_stepvalidation_epoch_endon_validation_starton_validation_model_trainon_validation_model_evalon_validation_epoch_starton_validation_epoch_endon_validation_endon_validation_batch_starton_validation_batch_endinit_validation_tqdmenable_validationdisable_validation_on_validation_start_log_on_validation_epoch_start_log_on_validation_epoch_end_log_on_validation_end_log_on_validation_batch_start_log_on_validation_batch_end_log
...while a handful use "val" instead:
val_transformsval_step_contextval_dataloaderval_batch_idxtotal_val_batchesshould_check_val_fxreset_val_dataloaderreset_train_val_dataloadersnum_seen_val_check_batches
I wasn't able to see any obvious pattern in which methods got which naming convention, and think having a consistent convention throughout would make for a (slightly) cleaner and easier-to-learn library.
Related: #634
Pitch
Standardize all validation-related methods (and properties, if any exist) to use the same naming convention; either "val" (for consistency with e.g. torchvision) or "validation" (for consistency with the bulk of the current Lightning API). Renamed methods would be marked as deprecated and removed in the next major version bump.