Skip to content

PyTorch Toolbelt 0.5.0

Compare
Choose a tag to compare
@BloodAxe BloodAxe released this 10 Mar 21:22
· 398 commits to master since this release
8bc1cd1

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 to print 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 and match_bboxes_hungarian. The first method uses scores of predicted bboxes and matches most confident predictions first, while the match_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 to ApplySoftmaxTo 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 a device (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 and BalancedBCEWithLogitsLoss now supports ignore_index argument.
  • BiTemperedLogisticLoss & BinaryBiTemperedLogisticLoss also got support of ignore_index argument.
  • focal_loss_with_logits now also supports ignore_index. Computation of ignored values has been moved from BinaryFocalLoss to this function.
  • Reduced number of boilerplates & hardcoded code for encoders from timm. Now GenericTimmEncoder queries output strides & feature maps directly from the timm'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 supports Path as input argument. Return type (str) remains unchanged.
  • count_parameters now accepts human_friendly argument to print parameters count in human-friendly form 21.1M instead 21123123.
  • plot_confusion_matrix now has format_string argument (None by default) to specify custom format string for values in confusion matrix.
  • RocAucMetricCallback for Catalyst got fix_nans argument to fix NaN outputs, which caused roc_auc to raise an exception and break the training.
  • BestWorstMinerCallbac now additionally logs batch with NaN value in monitored metric