In base_pytorch_nn.py, BasePyTorchClassifier defines a train(dataloader) method.
This overlaps semantically with torch.nn.Module.train(), which is normally used to switch the module to training mode (optionally with a boolean flag), not to run a full training loop.
Because of this name overlap, the API can be confusing and may lead to unintended usage when users expect PyTorch-native behavior from .train().
Current behavior
BasePyTorchClassifier.train(dataloader) triggers trainer-based fitting.
- The wrapped model’s native mode switch method (
model.train()) is a different concept.
Why this is a problem
- Naming collision with a very common PyTorch API.
- Higher risk of misuse and reduced readability.
Suggested fix
- Rename
BasePyTorchClassifier.train(...) to something unambiguous like fit(...) or fit_model(...).
- Keep backward compatibility with a deprecation warning on
train(...) for one release cycle.
In base_pytorch_nn.py,
BasePyTorchClassifierdefines atrain(dataloader)method.This overlaps semantically with
torch.nn.Module.train(), which is normally used to switch the module to training mode (optionally with a boolean flag), not to run a full training loop.Because of this name overlap, the API can be confusing and may lead to unintended usage when users expect PyTorch-native behavior from
.train().Current behavior
BasePyTorchClassifier.train(dataloader)triggers trainer-based fitting.model.train()) is a different concept.Why this is a problem
Suggested fix
BasePyTorchClassifier.train(...)to something unambiguous likefit(...)orfit_model(...).train(...)for one release cycle.