https://github.com/chagmgang/simclr_pytorch
A Simple Framework for Contrastive Learning of Visual Representations of pytorch implementation
https://github.com/chagmgang/simclr_pytorch
deep-learning pytorch representation-learning simclr
Last synced: about 1 month ago
JSON representation
A Simple Framework for Contrastive Learning of Visual Representations of pytorch implementation
- Host: GitHub
- URL: https://github.com/chagmgang/simclr_pytorch
- Owner: chagmgang
- Created: 2020-03-16T12:48:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T00:11:01.000Z (over 6 years ago)
- Last Synced: 2025-08-10T10:29:34.694Z (11 months ago)
- Topics: deep-learning, pytorch, representation-learning, simclr
- Language: Python
- Homepage:
- Size: 2.53 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Simple Framework for Contrastive Learning of Visual Representations with Pytorch
* Pytorch Impementation [A Simple Framework for Contrastive Learning of Visual Representations](https://arxiv.org/abs/2002.05709)
## DataAugmentation
| | negative | negative | negative | negative |
|---|---|---|---|---|
| positive |  |  |  |  |
| positive |  |  |  |  |
## Dependency
```
python-opencv
torch
torchvision
matplotlib
pandas
PIL
```
## Directory
```
├── data
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── ...
│ ├── 5.jpg
│ └── 6.jpg
├── .gitignore
├── dataset_wrapper.py
├── model.py
├── nt_xent_loss.py
├── README.md
└── simclr.py
```
## RUN
```
(pytorch) xxx:xxx xxx$ python simclr.py
----------------
epoch : 0
loss : 1.5892890691757202
lr : 0.0003
----------------
epoch : 1
loss : 1.5985093116760254
lr : 0.00029699999999999996
----------------
...
----------------
epoch : 5
loss : 0.6665001213550568
lr : 0.00028529701496999996
----------------
epoch : 6
loss : 0.5047109872102737
lr : 0.0002824440448203
----------------
epoch : 7
loss : 0.4476690739393234
lr : 0.00027961960437209696
----------------
```
## Reference
* [A Simple Framework for Contrastive Learning of Visual Representations](https://arxiv.org/abs/2002.05709)
* [https://github.com/sthalles/SimCLR](https://github.com/sthalles/SimCLR)