24、CrosNNCLR:用于自监督动作表示的跨视图最近邻对比学习框架

CrosNNCLR:用于自监督动作表示的跨视图最近邻对比学习框架

1. CrosNNCLR算法伪代码

CrosNNCLR是一种用于自监督动作表示学习的方法,其核心算法的伪代码如下:

# Query, Key: encoder network
# N: batch size
# MB: memory bank(queue)
# t: temperature
for x in loader:
    x1, x2 = aug(x), aug(x) # random augmentation
    z1, z2 = Query(x1), Key(x2) # obtain the encoded features
    h1, h2, mb = normalize(z1), normalize(z2), normalize(MB) # l2-normalize
    NN1 = NN(h1, mb) # cross-view the nearest neighbor index
    NN2 = NN(h2, mb) # cross-view the nearest neighbor index
    loss = L(NN1, h2, h1)/2 + L(NN2, h1, h2)/2 # Loss_CrosNNCLR
    loss.backward() # back-propagate
    update([Query.params, Key.params]) # SGD update
    update_queue(MB, z2)

def L(nn, c, d, t=0.07):
    logits_cd = mm(c,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值