Recent Posts by admin
Create DataLoader with collate_fn() for variable-length input in PyTorch.
A custom collate_fn can be used to customize collation, e.g., padding sequential data to a max length of a batch.collate_fn is called with a list of data samples at each time. It is expected to collate the input samples into a batch for yielding from the data loader iterator.
Micro and Macro Averages for imbalance multiclass classification
A macro-average will compute the metric independently for each class and then take the average hence treating all classes equally, whereas a micro-average will aggregate the contributions of all classes to compute the average metric.
Explain Pooling layers: Max Pooling, Average Pooling, Global Average Pooling, and Global Max pooling.
Global Average Pooling does something different. It applies average pooling on the spatial dimensions until each spatial dimension is one, and leaves other dimensions unchanged.