Predict method to label new data
🚀 Feature
A method to make predictions on new data.
Motivation
In a machine learning project, once the model has been trained and evaluated (using the validation_step and the test_step), it would be useful to have a method to make predictions on new, unlabelled, data.
Making predictions for just 1 observation is straight-forward by calling model(new_data). However, to predict on a large dataset, we need to create a dataloader and loop through it while concatenating the outputs. It would be great to integrate that to PyTorch Lightning to take advantage of the ease of implementation, especially regarding multi-gpus.
Pitch
Load a pre-trained model and use it for prediction by calling something like:
model = myLightning_model.load_from_checkpoint(path/to/checkpoint )
predicted_labels = model.predict(newdata_dataloader)

Alternatives
The standard PyTorch way to do it, with the usual issues with managing devices and parallel processing:
prediction_list = []
for i, batch in enumerate(dataloader):
    output = model(batch)
    output = model.proba(output) # if not part of forward already
    prediction_list.append(output)
Additional context