Skip to content

Commit

Permalink
Fix sequence length for sites
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukh-P committed Jan 21, 2025
1 parent a060d15 commit 5624ad2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pvnet/models/multimodal/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(
assert pv_history_minutes is not None

self.pv_encoder = pv_encoder(
sequence_length=pv_history_minutes // pv_interval_minutes - 1,
sequence_length=pv_history_minutes // pv_interval_minutes + 1,
target_key_to_use=self._target_key_name,
input_key_to_use="site",
)
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/site_encoders/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def __init__(
self.input_key_to_use = input_key_to_use
self.num_channels = num_channels
self.num_sites_in_inference = num_sites_in_inference
print(self.sequence_length, 'SEQUENCE LENGTH')

if use_id_in_value:
self.value_id_embedding = nn.Embedding(num_sites, id_embed_dim)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def site_encoder_model_kwargs():
def site_encoder_model_kwargs_dsampler():
# Used to test site encoder model on PV data
kwargs = dict(
sequence_length=60 // 15 - 1, num_sites=1, out_features=128, target_key_to_use="site"
sequence_length=60 // 15 + 1, num_sites=1, out_features=128, target_key_to_use="site"
)
return kwargs

Expand Down

0 comments on commit 5624ad2

Please sign in to comment.