Skip to content

Commit

Permalink
Merge pull request #242 from openclimatefix/fix-time
Browse files Browse the repository at this point in the history
fix issue with time features missing in forward multimodal.py
  • Loading branch information
AUdaltsova authored Aug 7, 2024
2 parents 9a7e70e + 9677877 commit d87acd0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pvnet/models/multimodal/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,19 @@ def forward(self, x):
sun = self.sun_fc1(sun)
modes["sun"] = sun

if self.include_time:
time = torch.cat(
(
x[BatchKey[f"{self._target_key_name}_date_sin"]],
x[BatchKey[f"{self._target_key_name}_date_cos"]],
x[BatchKey[f"{self._target_key_name}_time_sin"]],
x[BatchKey[f"{self._target_key_name}_time_cos"]],
),
dim=1,
).float()
time = self.time_fc1(time)
modes["time"] = time

out = self.output_network(modes)

if self.use_quantile_regression:
Expand Down

0 comments on commit d87acd0

Please sign in to comment.