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

Method __init__

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

Source from the content-addressed store, hash-verified

6class BaseMoCo(nn.Module):
7 """base class for MoCo-style memory cache"""
8 def __init__(self, K=65536, T=0.07):
9 super(BaseMoCo, self).__init__()
10 self.K = K
11 self.T = T
12 self.index = 0
13
14 def _update_pointer(self, bsz):
15 self.index = (self.index + bsz) % self.K

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected