MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

layers/Embed.py:132–138  ·  view source on GitHub ↗
(self, d_model, embed_type='timeF', freq='h')

Source from the content-addressed store, hash-verified

130
131class TimeFeatureEmbedding_new(nn.Module):
132 def __init__(self, d_model, embed_type='timeF', freq='h'):
133 super(TimeFeatureEmbedding_new, self).__init__()
134
135 freq_map = {'h': 4, 't': 5, 's': 6, 'm': 1, 'a': 1, 'w': 2, 'd': 3, 'b': 3}
136 d_inp = freq_map[freq]
137 self.embed = nn.Linear(d_inp+1, d_model, bias=False)
138 self.concats = dict()
139
140 def forward(self, x, scale=1):
141 if (scale, x.shape[0], x.shape[1]) not in self.concats:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected