Hi,
Great work, thank you. I wanted to ask you about decoder inputs because when I checked your data loader and decoder layer I saw:
def window(
df: pd.DataFrame,
size: int,
driving_series: List[str],
target_series: List[str],
):
X = df[driving_series].values
y = df[target_series].values
X_T = []
y_T = []
for i in range(len(X) - size + 1):
X_T.append(X[i : i + size])
y_T.append(y[i : i + size])
return np.array(X_T), np.array(y_T)
and
with tf.variable_scope("DecoderRNN"):
# TODO: check order of hidden states and cell states
cell = LSTMCell(self.config.p, state_is_tuple=True)
initial_state = cell.zero_state(self.config.batch_size, tf.float32)
c_t = tf.get_variable("c_t", [self.config.batch_size, self.config.m])
state = initial_state
s_, d = state
for t in range(self.config.T):
# if t > 0: tf.get_variable_scope().reuse_variables()
if self.config.temporal_att_enabled:
beta = self._attention(d, s_, encoder_outputs)
c_t = tf.reduce_sum(beta * encoder_outputs, axis=1)
else:
c_t = encoder_outputs[:, t, :]
if t < self.config.T - 1:
y_c = tf.concat([tf.expand_dims(past_history[:, t], -1), c_t], axis=1)
y_tilde = tf.layers.dense(y_c, 1)
(cell_output, state) = cell(y_tilde, state)
s_, d = state
d_c = tf.concat([d, c_t], axis=1)
y_T = tf.layers.dense(tf.layers.dense(d_c, self.config.p), 1)
y_T = tf.squeeze(y_T)
loss = tf.losses.mean_squared_error(y_T, past_history[:, - 1])
return y_T, loss
Correct me if I am mistaken, but I feel like in these 2 functions you are using the same array for both target variable and decoder inputs then you are only feeding T-1 steps to decoder, shouldn't it be if t < self.config.T :
instead of if t < self.config.T - 1:
because I feel like when it is like that you are only feeding past 8 steps to decoder instead of past 9 steps as suggested in the paper?
Thank you