Extract dataset definition out of the LightningModule
🚀 Feature
Extract dataset definition out of the LightningModule
Motivation
Separation of data from the model.
Pitch
The datasets loaders could easily be passed to the fit method directly instead of having to define them inside the LightningModule, this avoids having a single class that possibly contains: data, data pipeline params, model, model hyperparams.
The basic example cloud look like this:
from pytorch_lightning import Trainer

train_dataloader = DataLoader(...)
val_dataloader = DataLoader(...)

model = CoolSystem()

# most basic trainer, uses good defaults
trainer = Trainer()    
trainer.fit(model, train_dataloader=train_dataloader, val_dataloader=val_dataloader)
Its much more natural to how you usually structure your code in scikit-learn or keras.
Alternatives
They could also be based to the Trainers constructor.