# Python Implementation of Contrastive Learning

## Introduction

Contrastive learning is a self-supervised learning method to learn representations by contrasting positive and negative examples. For self-supervised contrastive learning, the next equation shows the contrastive loss:

where $\textbf{z}_i$ is the embedding of sample $i$ and $\tau \in \mathcal{R}^{+}$ is the temperature parameter.

## Codes

There are two versions to implement contrastive loss：

OmegaXYZ.com