@@ -209,7 +209,7 @@ def __init__(
209
209
assert pv_history_minutes is not None
210
210
211
211
self .pv_encoder = pv_encoder (
212
- sequence_length = pv_history_minutes // pv_interval_minutes ,
212
+ sequence_length = pv_history_minutes // pv_interval_minutes + 1 ,
213
213
target_key_to_use = self .target_key_name ,
214
214
input_key_to_use = "pv" ,
215
215
)
@@ -222,7 +222,7 @@ def __init__(
222
222
wind_history_minutes = history_minutes
223
223
224
224
self .wind_encoder = wind_encoder (
225
- sequence_length = wind_history_minutes // wind_interval_minutes ,
225
+ sequence_length = wind_history_minutes // wind_interval_minutes + 1 ,
226
226
target_key_to_use = self .target_key_name ,
227
227
input_key_to_use = "wind" ,
228
228
)
@@ -235,7 +235,7 @@ def __init__(
235
235
sensor_history_minutes = history_minutes
236
236
237
237
self .sensor_encoder = sensor_encoder (
238
- sequence_length = sensor_history_minutes // sensor_interval_minutes ,
238
+ sequence_length = sensor_history_minutes // sensor_interval_minutes + 1 ,
239
239
target_key_to_use = self .target_key_name ,
240
240
input_key_to_use = "sensor" ,
241
241
)
@@ -306,7 +306,7 @@ def forward(self, x):
306
306
# Target is PV, so only take the history
307
307
# Copy batch
308
308
x_tmp = x .copy ()
309
- x_tmp [BatchKey .pv ] = x_tmp [BatchKey .pv ][:, : self .history_len ]
309
+ x_tmp [BatchKey .pv ] = x_tmp [BatchKey .pv ][:, : self .history_len + 1 ]
310
310
modes ["pv" ] = self .pv_encoder (x_tmp )
311
311
312
312
# *********************** GSP Data ************************************
@@ -329,7 +329,7 @@ def forward(self, x):
329
329
else :
330
330
# Have to be its own Batch format
331
331
x_tmp = x .copy ()
332
- x_tmp [BatchKey .wind ] = x_tmp [BatchKey .wind ][:, : self .history_len ]
332
+ x_tmp [BatchKey .wind ] = x_tmp [BatchKey .wind ][:, : self .history_len + 1 ]
333
333
# This needs to be a Batch as input
334
334
modes ["wind" ] = self .wind_encoder (x_tmp )
335
335
@@ -339,7 +339,7 @@ def forward(self, x):
339
339
modes ["sensor" ] = self .sensor_encoder (x )
340
340
else :
341
341
x_tmp = x .copy ()
342
- x_tmp [BatchKey .sensor ] = x_tmp [BatchKey .sensor ][:, : self .history_len ]
342
+ x_tmp [BatchKey .sensor ] = x_tmp [BatchKey .sensor ][:, : self .history_len + 1 ]
343
343
# This needs to be a Batch as input
344
344
modes ["sensor" ] = self .sensor_encoder (x_tmp )
345
345
0 commit comments