We can now reduce the precision of tensors while writing them to disc using H5FileImageWriter.
The utility functions used by callbacks are now moved to ahcore.utils under callbacks.
The model outputs are logits of type float32 and hence dumping them into disc creates large h5 files. This is optimised by adding an optional normalization function (one of softmax, sigmoid) to scale the logits appropriately. The user can also set a precision of their choice (either float32, float16 or uint8).
Some minor changes has been made to pre transfroms to handle empty tiles better.
@moerlemans Thanks for the comment. I added NormalizationTypes to leave this up to the user. I agree that passing all outputs through sigmoid may not be the best way to go.
This PR makes the following changes:
H5FileImageWriter
.float32
and hence dumping them into disc creates large h5 files. This is optimised by adding an optional normalization function (one of softmax, sigmoid) to scale the logits appropriately. The user can also set a precision of their choice (either float32, float16 or uint8).