MCPcopy Create free account
hub / github.com/HobbitLong/PyContrast / __init__

Method __init__

pycontrast/memory/mem_moco.py:93–99  ·  view source on GitHub ↗
(self, n_dim, K=65536, T=0.07)

Source from the content-addressed store, hash-verified

91class CMCMoCo(BaseMoCo):
92 """MoCo-style memory for two modalities, e.g. in CMC"""
93 def __init__(self, n_dim, K=65536, T=0.07):
94 super(CMCMoCo, self).__init__(K, T)
95 # create memory queue
96 self.register_buffer('memory_1', torch.randn(K, n_dim))
97 self.register_buffer('memory_2', torch.randn(K, n_dim))
98 self.memory_1 = F.normalize(self.memory_1)
99 self.memory_2 = F.normalize(self.memory_2)
100
101 def forward(self, q1, k1, q2, k2,
102 q1_jig=None, q2_jig=None,

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected