def __init__(self, hete, hidden_size, dropout):
     super(HeteroNet, self).__init__()
     
     conv1, conv2 = generate_convs(
         hete, HeteroSAGEConv, hidden_size, task='link_pred'
     )
     self.conv1 = HeteroConv(conv1)
     self.conv2 = HeteroConv(conv2)
     self.loss_fn = torch.nn.BCEWithLogitsLoss()
     self.dropout = dropout
 def __init__(self, hete, hidden_size, dropout):
     super(HeteroNet, self).__init__()
     conv1, conv2 = generate_convs(hete, HeteroSAGEConv, hidden_size)
     self.conv1 = HeteroConv(conv1)
     self.conv2 = HeteroConv(conv2)
     self.relus1 = nn.ModuleDict()
     self.relus2 = nn.ModuleDict()
     self.dropouts1 = nn.ModuleDict()
     self.dropouts2 = nn.ModuleDict()
     for node_type in hete.node_types:
         self.relus1[node_type] = nn.LeakyReLU()
         self.relus2[node_type] = nn.LeakyReLU()
         self.dropouts1[node_type] = nn.Dropout(p=dropout)
         self.dropouts2[node_type] = nn.Dropout(p=dropout)
Ejemplo n.º 3
0
    def __init__(self, hete, hidden_size, dropout):
        super(HeteroNet, self).__init__()

        conv1, conv2 = generate_convs(hete,
                                      HeteroSAGEConv,
                                      hidden_size,
                                      task='link_pred')
        self.conv1 = HeteroConv(conv1)
        self.conv2 = HeteroConv(conv2)
        self.loss_fn = torch.nn.BCEWithLogitsLoss()
        self.dropout1 = nn.ModuleDict()
        self.relu1 = nn.ModuleDict()
        self.dropout2 = nn.ModuleDict()
        self.relu2 = nn.ModuleDict()

        for node_type in hete.node_types:
            self.dropout1[node_type] = nn.Dropout(p=dropout)
            self.dropout2[node_type] = nn.Dropout(p=dropout)
            self.relu1[node_type] = nn.LeakyReLU()
            self.relu2[node_type] = nn.LeakyReLU()
Ejemplo n.º 4
0
 def __init__(self, hete, hidden_size, dropout):
     super(HeteroNet, self).__init__()
     self.dropout = dropout
     conv1, conv2 = generate_convs(hete, HeteroSAGEConv, hidden_size)
     self.conv1 = HeteroConv(conv1)
     self.conv2 = HeteroConv(conv2)