Skip to content

Commit

Permalink
Revert batch key change
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhil Patel authored and Sukhil Patel committed Feb 14, 2025
1 parent df806ee commit 9ae7b0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pvnet/models/multimodal/site_encoders/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import einops
import torch
from ocf_datapipes.batch import BatchKey
from torch import nn

from pvnet.models.multimodal.linear_networks.networks import ResFCNet2
Expand Down Expand Up @@ -74,13 +75,13 @@ def __init__(
)

def _calculate_attention(self, x):
gsp_ids = x["gsp_id"].squeeze().int()
gsp_ids = x[BatchKey.gsp_id].squeeze().int()
attention = self._attention_network(gsp_ids)
return attention

def _encode_value(self, x):
# Shape: [batch size, sequence length, PV site]
pv_site_seqs = x["pv"].float()
pv_site_seqs = x[BatchKey.pv].float()
batch_size = pv_site_seqs.shape[0]

pv_site_seqs = pv_site_seqs.swapaxes(1, 2).flatten(0, 1)
Expand Down

0 comments on commit 9ae7b0b

Please sign in to comment.