MCPcopy Create free account
hub / github.com/IntelligentSystemsLab/ST-EVCDP / __getitem__

Method __getitem__

functions.py:140–151  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

138 return len(self.occ)
139
140 def __getitem__(self, idx): # occ: batch, seq, node
141 # Pseudo Sampling
142 prc_ch = torch.Tensor(self.prc[idx, :, :] * (1+self.prc_chg)) # [node, seq]
143 label_ch = torch.tan(torch.Tensor(self.label[idx, :] * (1+self.label_chg/self.law))) # [node, ]
144
145 # to device
146 output_occ = torch.transpose(self.occ[idx, :, :], 0, 1).to(self.device)
147 output_prc = torch.transpose(self.prc[idx, :, :], 0, 1).to(self.device)
148 output_label = self.label[idx, :].to(self.device)
149 output_prc_ch = torch.transpose(prc_ch, 0, 1).to(self.device)
150 output_label_ch = label_ch.to(self.device)
151 return output_occ, output_prc, output_label, output_prc_ch, output_label_ch
152
153
154class PseudoDataset(Dataset):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected