PyTorch Toolbelt 0.2.0
PyTorch Toolbelt 0.2.0
This release dedicated to housekeeping work. Dice/IoU metrics and losses have been redesigned to reduce amount of duplicated code and bring more clarity. Code is now auto-formatted using Black.
pip install pytorch_toolbelt==0.2.0
Catalyst contrib
- Refactor Dice/IoU loss into single metric
IoUMetricsCallback
with a few cool features:metric="dice|jaccard"
to choose what metric should be used;mode=binary|multiclass|multilabel
to specify problem type (binary, multiclass or multi-label segmentation)';classes_of_interest=[1,2,4]
to select for which set of classes metric should be computed andnan_score_on_empty=False
to computeDice Accuracy
(Counts as a 1.0 if bothy_true
andy_pred
are empty; 0.0 ify_pred
is not empty). - Added L-p regularization callback to apply L1 and L2 regularization to model with support of regularization strength scheduling.
Losses
- Refactor
DiceLoss
/JaccardLoss
losses in a same fashion as metrics.
Models
- Add Densenet encoders
- Bugfix: Fix missing BN+Relu in
UNetDecoder
- Global pooling modules can squeeze spatial channel dimensions if
flatten=True
.
Misc
- Add more unit tests
- Code-style is now managed with Black
to_numpy
now supportsint
,float
scalar types