avalanche.training.AMLCriterion

class avalanche.training.AMLCriterion(feature_extractor, temp: float = 0.1, base_temp: float = 0.07, same_task_neg: bool = True, device: str = 'cpu')[source]

Asymmetric metric learning (AML) Criterion used in “New Insights on Reducing Abrupt Representation Change in Online Continual Learning” by Lucas Caccia et. al. https://openreview.net/forum?id=N8MaByOzUfb

__init__(feature_extractor, temp: float = 0.1, base_temp: float = 0.07, same_task_neg: bool = True, device: str = 'cpu')[source]

ER_AML criterion constructor. :param feature_extractor: Model able to map an input in a latent space. :param temp: Supervised contrastive temperature. :param base_temp: Supervised contrastive base temperature. :param same_task_neg: Option to remove negative samples of different tasks. :param device: Accelerator used to speed up the computation.

Methods

__init__(feature_extractor[, temp, ...])

ER_AML criterion constructor.

post_adapt(agent, exp)

pre_adapt(agent, exp)

update(*args, **kwargs)

Warning: Deprecated (removal in version 0.7: please switch to pre_update and post_update methods.)