Skip to content

Callbacks

modelgenerator.callbacks.PredictionWriter

Bases: Callback

Write batch predictions to files, and merge batch files into a single file at the end of the epoch. Note: When saving the given data to a TSV file, any tensors in the data will have their last dimension squeezed and converted into lists to ensure proper formatting for TSV output.

Parameters:

Name Type Description Default
output_dir str

Directory to save predictions.

required
filetype str

Type of outputfile. Options are 'tsv' and 'pt'.

required
write_cols list

The head columns of tsv file if filetype is set to 'tsv'. Defaults to None

None