PyTorch Toolbelt 0.5.0
Version 0.5.0
This is the major release update of Pytorch Toolbelt. It's been a long time since the last update and there are many improvements & updates since 0.4.4:
New features
- Added class
pytorch_toolbelt.datasets.DatasetMeanStdCalculator
to compute mean & std of the dataset that does not fit entirely in memory. - New decoder module:
BiFPNDecoder
- New encoders:
SwinTransformer
,SwinB
,SwinL
,SwinT
,SwinS
- Added
broadcast_from_master
function to distributed utils. This method allows scattering a tensor from the master node to all nodes. - Added
reduce_dict_sum
to gather & concatenate dictionary of lists from all nodes in DDP. - Added
master_print
as a drop-in replacement toprint
that prints to stdout only on the zero-rank node.
Bug Fixes
Breaking changes
- Bounding boxes matching method has been divided into two:
match_bboxes
andmatch_bboxes_hungarian
. The first method uses scores of predicted bboxes and matches most confident predictions first, while thematch_bboxes_hungarian
matches bboxes to maximize overall IoU. set_manual_seed
now sets random seed for Numpy.to_numpy
now correctly works for None and all iterables (Not only tuple & list)
Fixes & Improvements (NO BC)
- Added
dim
argument toApplySoftmaxTo
to specify channel for softmax operator (default value is 1, which was hardcoded previously) ApplySigmoidTo
now applies in-place sigmoid (Purely performance optimization)TileMerger
now supports specifying adevice
(Torch semantics) for storing intermediate tensors of accumulated tiles.- All TTA functions supports PyTorch Tracing
MultiscaleTTA
now supports a model that returns a single Tensor (Key-Value outputs still works as before)balanced_binary_cross_entropy_with_logits
andBalancedBCEWithLogitsLoss
now supportsignore_index
argument.BiTemperedLogisticLoss
&BinaryBiTemperedLogisticLoss
also got support ofignore_index
argument.focal_loss_with_logits
now also supportsignore_index
. Computation of ignored values has been moved fromBinaryFocalLoss
to this function.- Reduced number of boilerplates & hardcoded code for encoders from
timm
. NowGenericTimmEncoder
queries output strides & feature maps directly from thetimm
's encoder instance. - HRNet-based encoders now have a
use_incre_features
argument to specify whether output feature maps should have an increased number of features. change_extension
,read_rgb_image
,read_image_as_is
functions now supportsPath
as input argument. Return type (str) remains unchanged.count_parameters
now acceptshuman_friendly
argument to print parameters count in human-friendly form21.1M
instead 21123123.plot_confusion_matrix
now hasformat_string
argument (None by default) to specify custom format string for values in confusion matrix.RocAucMetricCallback
for Catalyst gotfix_nans
argument to fixNaN
outputs, which causedroc_auc
to raise an exception and break the training.BestWorstMinerCallbac
now additionally logs batch withNaN
value in monitored metric