Skip to content

Commit b0fb27f

Browse files
author
Jasper
authored
torch.SimpleFeedForward: Rename context to past_target. (#2704)
1 parent d60e299 commit b0fb27f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/gluonts/torch/model/simple_feedforward

src/gluonts/torch/model/simple_feedforward/module.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595
def describe_inputs(self, batch_size=1) -> InputSpec:
9696
return InputSpec(
9797
{
98-
"context": Input(
98+
"past_target": Input(
9999
shape=(batch_size, self.context_length), dtype=torch.float
100100
),
101101
},
@@ -104,10 +104,10 @@ def describe_inputs(self, batch_size=1) -> InputSpec:
104104

105105
def forward(
106106
self,
107-
context: torch.Tensor,
107+
past_target: torch.Tensor,
108108
) -> Tuple[Tuple[torch.Tensor, ...], torch.Tensor, torch.Tensor]:
109-
scale = mean_abs_scaling(context)
110-
scaled_context = context / scale
109+
scale = mean_abs_scaling(past_target)
110+
scaled_context = past_target / scale
111111
nn_out = self.nn(scaled_context)
112112
nn_out_reshaped = nn_out.reshape(
113113
-1, self.prediction_length, self.hidden_dimensions[-1]

0 commit comments

Comments
 (0)