SupContrast:PyTorch实施“监督式对比学习”(顺带SimCLR)

时间:2024-04-07 20:39:33
【文件属性】:

文件名称:SupContrast:PyTorch实施“监督式对比学习”(顺带SimCLR)

文件大小:1.44MB

文件格式:ZIP

更新时间:2024-04-07 20:39:33

Python

SupContrast:监督式对比学习 此库使用CIFAR作为说明性示例,涵盖了PyTorch中以下论文的参考实现: (1)监督式对比学习。(2)视觉表示对比学习的简单框架。 损失函数 损耗函数在losses.py花费features (L2归一化)和labels作为输入,并返回损耗。如果labels为None或未传递给它,则它会退化为SimCLR。 用法: from losses import SupConLoss # define loss with a temperature `temp` criterion = SupConLoss ( temperature = temp ) # features: [bsz, n_views, f_dim] # `n_views` is the number of crops from each image # better be L2 no


【文件预览】:
SupContrast-master
----.gitignore(2KB)
----networks()
--------resnet_big.py(7KB)
----main_linear.py(8KB)
----LICENSE(1KB)
----main_ce.py(11KB)
----README.md(4KB)
----util.py(3KB)
----figures()
--------SupContrast.jpg(443KB)
--------teaser.png(421KB)
--------SupCE.jpg(116KB)
--------.DS_Store(6KB)
--------SimCLR.jpg(731KB)
----main_supcon.py(10KB)
----losses.py(4KB)

网友评论