Skip to content

semipy.methods.utils.DistAlign

Warning

This section is in construction.

    class semipy.methods.utils.DistAlign(num_classes: int,
                                         momentum: float,
                                         buffer_size: int = 128,
                                         distributed: bool = False,
                                         module=None,
                                         lightning_module=None)

This class performs Distribution Alignment. Originally performed in ReMixMatch (Berthelot et al., 2020) (See 3.1.2). This version is modified for AdaMatch where the labelled distribution is estimated from the output of the model rather than from the true labels, as implemented here.

Parameters

  • num_classes (int) - Number of classes in the used dataset.
  • momentum (float) - EMA decay for updating labelled probabilities.
  • buffer_size (int) - Size of the sliding window. Default: 128
  • distributed (bool) - Set to True if using multi-GPU training. Default: False
  • module - A semipy.method.abstractMethod based module for the used method (for example semipy.method.FixMatch) (Use only if not using PyTorch Lightning).
  • lightning_module - A PyTorch Lightning module. Use only when using PyTorch Lightning.