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

Method __getitem__

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

Source from the content-addressed store, hash-verified

190 return len(self.occ)
191
192 def __getitem__(self, idx): # occ: batch, seq, node
193 # sampling
194 pseudo_prc = torch.Tensor(self.prc[idx, :, :] * (1+self.prc_chg)) # [node, seq]
195 pseudo_label = torch.tan(torch.Tensor(self.label[idx, :] * (1+self.label_chg))) # [node, ]
196
197 # to device
198 output_occ = torch.transpose(self.occ[idx, :, :], 0, 1).to(self.device)
199 output_prc = torch.transpose(self.prc[idx, :, :], 0, 1).to(self.device)
200 output_label = self.label[idx, :].to(self.device)
201 output_pseudo_prc = torch.transpose(pseudo_prc, 0, 1).to(self.device)
202 output_pseudo_label = pseudo_label.to(self.device)
203
204 return output_occ, output_prc, output_label, output_pseudo_prc, output_pseudo_label
205
206
207def meta_division(data, support_rate, query_rate):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected