Dom wise graph representation
1 unresolved thread
1 unresolved thread
Compare changes
Files
5+ 40
− 0
@@ -19,6 +19,7 @@ class SQLiteDataset(torch.utils.data.Dataset):
@@ -37,6 +38,8 @@ class SQLiteDataset(torch.utils.data.Dataset):
@@ -44,6 +47,7 @@ class SQLiteDataset(torch.utils.data.Dataset):
@@ -118,6 +122,36 @@ class SQLiteDataset(torch.utils.data.Dataset):
Created by: RasmusOrsoe
It's fairly performant, but it is slower than the pulse representation. I agree with your suggestion and would welcome input on how to vectorize this. I thought about it a bit and sought inspiration from your upgrade code, but I could not see a direct application for this. So I'd be quite interested to see the solution.
@@ -161,12 +195,18 @@ class SQLiteDataset(torch.utils.data.Dataset):
Created by: asogaard
DRY. Also, the check for
node_representation in ['pulse', 'node']
should probably be done in the constructor, such that we can assume that it has a standard value in all other methods. I'll assume that here to simplify.x = torch.tensor(data, dtype=self._dtype) n_pulses = torch.tensor(len(x), dtype=torch.int32) graph = Data( x=x, edge_index= None ) if self._node_representation == 'dom': graph = self._make_dom_wise_representation(graph)
Created by: asogaard
This would probably be best suited for an "enum" or similar type of structure (i.e., to have a fixed set of options), but this is perfectly fine for now.
Created by: asogaard
If you stick to strings, though, I would add a
assert node_representation in ['pulse', 'node']
check in the constructor (see also comment below).