MCPcopy Create free account
hub / github.com/ElliotVincent/SitsSCD / __init__

Method __init__

models/networks/positional_encoding.py:6–14  ·  view source on GitHub ↗
(self, d, T=730, repeat=None, offset=0)

Source from the content-addressed store, hash-verified

4
5class PositionalEncoder(nn.Module):
6 def __init__(self, d, T=730, repeat=None, offset=0):
7 super(PositionalEncoder, self).__init__()
8 self.d = d
9 self.T = T
10 self.repeat = repeat
11 self.denom = torch.pow(
12 T, 2 * torch.div(torch.arange(offset, offset + d).float(), 2, rounding_mode='floor') / (d+offset)
13 )
14 self.updated_location = False
15
16 def forward(self, batch_positions):
17 if not self.updated_location:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected