Skip to content

Commit 61794d6

Browse files
FIX: Remove additional useles stuff
1 parent 2b8408d commit 61794d6

File tree

1 file changed

+1
-82
lines changed

1 file changed

+1
-82
lines changed

modules/transforms/data_manipulations/manipulations.py

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -305,85 +305,4 @@ def forward(self, data: torch_geometric.data.Data):
305305
if key not in self.parameters["keep_fields"]:
306306
del data[key]
307307

308-
return data
309-
310-
class AlexanderDual(torch_geometric.transforms.BaseTransform):
311-
r"""The Alexander dual of a Simplicial Complex `\sigma` denoted
312-
`\bar{\sigma}` is the simplicial complex whose simplices are the
313-
complements of the simplices of `\sigma`.
314-
315-
Parameters
316-
----------
317-
**kwargs : optional
318-
Parameters for the transform.
319-
"""
320-
321-
def __init__(self, **kwargs):
322-
super().__init__()
323-
self.type = "alexander_dual"
324-
self.parameters = kwargs
325-
326-
def forward(self, data: torch_geometric.data.Data):
327-
r"""Apply the transform to the input data.
328-
329-
Parameters
330-
----------
331-
data : torch_geometric.data.Data
332-
The input data.
333-
334-
Returns
335-
-------
336-
torch_geometric.data.Data
337-
The transformed data.
338-
"""
339-
340-
G = to_networkx(data)
341-
S = SimplicialComplex(simplices=G)
342-
S_star = SimplicialComplex()
343-
344-
nodes = set(S.nodes)
345-
for s in S.simplices:
346-
s_bar = frozenset(nodes - set(s))
347-
if s_bar not in S:
348-
S_star.add_simplex(s)
349-
350-
S_star
351-
352-
return data
353-
354-
355-
class RandomGraph(torch_geometric.transforms.BaseTransform):
356-
r"""A transform that generates a random graph from the input data.
357-
358-
Parameters
359-
----------
360-
**kwargs : optional
361-
Parameters for the transform.
362-
"""
363-
364-
def __init__(self, **kwargs):
365-
super().__init__()
366-
self.type = "random_graph"
367-
self.parameters = kwargs
368-
369-
def forward(self, data: torch_geometric.data.Data):
370-
r"""Apply the transform to the input data.
371-
372-
Parameters
373-
----------
374-
data : torch_geometric.data.Data
375-
The input data.
376-
377-
Returns
378-
-------
379-
torch_geometric.data.Data
380-
The transformed data.
381-
"""
382-
383-
G = to_networkx(data)
384-
n = G.number_of_nodes()
385-
p = self.parameters["p"]
386-
G = nx.fast_gnp_random_graph(n, p)
387-
data = torch_geometric.utils.from_networkx(G)
388-
389-
return data
308+
return data

0 commit comments

Comments
 (0)