Module BML.transform.pyg_graph

Expand source code
from .graph import Graph
import torch
from torch_geometric.utils import from_networkx

class PyGgraph(Graph):
    
    fileExtension = ".pt"

    def __init__(self, primingFile, dataFile, params, outFolder, logFiles):
        Graph.__init__(self, primingFile, dataFile, params, outFolder, logFiles)
    
    def save(self):
        torch.save(self.transformedData, self.filePath)
        self.log("saved")

    def transforms(self, index, G):
        pyG = from_networkx(G)
        return(pyG)

Classes

class PyGgraph (primingFile, dataFile, params, outFolder, logFiles)
Expand source code
class PyGgraph(Graph):
    
    fileExtension = ".pt"

    def __init__(self, primingFile, dataFile, params, outFolder, logFiles):
        Graph.__init__(self, primingFile, dataFile, params, outFolder, logFiles)
    
    def save(self):
        torch.save(self.transformedData, self.filePath)
        self.log("saved")

    def transforms(self, index, G):
        pyG = from_networkx(G)
        return(pyG)

Ancestors

Class variables

var fileExtension

Methods

def save(self)
Expand source code
def save(self):
    torch.save(self.transformedData, self.filePath)
    self.log("saved")
def transforms(self, index, G)
Expand source code
def transforms(self, index, G):
    pyG = from_networkx(G)
    return(pyG)