Skip to content

Commit

Permalink
address #20
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jan 2, 2024
1 parent af64123 commit 0c41146
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions iTransformer/iTransformerNormConditioned.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(
super().__init__()
self.num_variates = num_variates
self.lookback_len = lookback_len
self.num_tokens_per_variate = num_tokens_per_variate

self.mem_tokens = nn.Parameter(torch.randn(num_mem_tokens, dim)) if num_mem_tokens > 0 else None

Expand Down Expand Up @@ -228,8 +229,12 @@ def forward(

# denormalize

x = rearrange(x, 'b (v n) d -> n b v d', n = self.num_tokens_per_variate)

x = (x * var.sqrt()) + mean

x = rearrange(x, 'n b v d -> b (v n) d')

# predicting multiple times

pred_list = [fn(x) for fn in self.pred_heads]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'iTransformer',
packages = find_packages(exclude=[]),
version = '0.5.1',
version = '0.5.2',
license='MIT',
description = 'iTransformer - Inverted Transformer Are Effective for Time Series Forecasting',
author = 'Phil Wang',
Expand Down

0 comments on commit 0c41146

Please sign in to comment.