def train(self, mode=True):
    'Populate label similarity map based on cosine similarity before running epoch\n\n        If the `num_negative_labels_to_sample` is set to an integer value then before starting\n        each epoch the model would create a similarity measure between the label names based\n        on cosine distances between their BERT encoded embeddings.\n        '
    if (mode and (self.num_negative_labels_to_sample is not None)):
        self._compute_label_similarity_for_current_epoch()
        super().train(mode)
    super().train(mode)
Populate label similarity map based on cosine similarity before running epoch

If the `num_negative_labels_to_sample` is set to an integer value then before starting
each epoch the model would create a similarity measure between the label names based
on cosine distances between their BERT encoded embeddings.
def train(self, mode=True):
    'Populate label similarity map based on cosine similarity before running epoch\n\n        If the `num_negative_labels_to_sample` is set to an integer value then before starting\n        each epoch the model would create a similarity measure between the label names based\n        on cosine distances between their BERT encoded embeddings.\n        '
    if (mode and (self.num_negative_labels_to_sample is not None)):
        self._compute_label_similarity_for_current_epoch()
        super().train(mode)
    super().train(mode)