yamle.methods.contrastive module#

class yamle.methods.contrastive.SimCLRVisionMethod(random_augment_num_ops=2, random_augment_magnitude=10, *args, **kwargs)[source]#

Bases: BaseMethod

This is the base class for contrastive pre-training of vision models.

It uses RandAugment to perform random augmentations on the input images to create two views.

Parameters:
  • random_augment_num_ops (int) – The number of random augmentations to perform. Defaults to 2.

  • random_augment_magnitude (int) – The magnitude of the random augmentations. Defaults to 10.

static add_specific_args(parent_parser)[source]#

This method is used to add arguments specific to this method to the parser.

Return type:

ArgumentParser