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

Method forward

models/NHits.py:196–203  ·  view source on GitHub ↗
(self, theta: t.Tensor, insample_x_t: t.Tensor, outsample_x_t: t.Tensor)

Source from the content-addressed store, hash-verified

194 super().__init__()
195
196 def forward(self, theta: t.Tensor, insample_x_t: t.Tensor, outsample_x_t: t.Tensor) -> Tuple[t.Tensor, t.Tensor]:
197 backcast_basis = insample_x_t
198 forecast_basis = outsample_x_t
199
200 cut_point = forecast_basis.shape[1]
201 backcast = t.einsum('bp,bpt->bt', theta[:, cut_point:], backcast_basis)
202 forecast = t.einsum('bp,bpt->bt', theta[:, :cut_point], forecast_basis)
203 return backcast, forecast
204
205class _ExogenousBasisWavenet(nn.Module):
206 def __init__(self, out_features, in_features, num_levels=4, kernel_size=3, dropout_prob=0):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected