Prediction Outputs
Module containing functions to convert prediction outputs to desired form.
combine_batches(predictions, tiled)
If predictions are in batches, they will be combined.
TODO improve description!
Parameters:
-
predictions(list) –Predictions that are output from
Trainer.predict. -
tiled(bool) –Whether the predictions are tiled.
Returns:
-
(list of numpy.ndarray) or tuple of (list of numpy.ndarray, list of TileInformation)–Combined batches.
convert_outputs(predictions, tiled)
Convert the Lightning trainer outputs to the desired form.
This method allows stitching back together tiled predictions.
Parameters:
-
predictions(list) –Predictions that are output from
Trainer.predict. -
tiled(bool) –Whether the predictions are tiled.
Returns:
-
list of numpy.ndarray or numpy.ndarray–list of arrays with the axes SC(Z)YX. If there is only 1 output it will not be in a list.
convert_outputs_pn2v(predictions, tiled)
Convert the Lightning trainer outputs to the desired form.
This method allows stitching back together tiled predictions.
Parameters:
-
predictions(list) –Predictions that are output from
Trainer.predict. Length of list the total number of tiles divided by the batch size. Each element consists of a tuple of ((prediction, mse), tile_info_list). 1st dimension of each tensor is the bs. Length of tile info list is the batch size. -
tiled(bool) –Whether the predictions are tiled.
Returns: