def __init__(self, config):
     super(MethodGraphBertNodeClassification, self).__init__(config)
     self.config = config
     self.bert = MethodGraphBert(config)
     self.res_h = torch.nn.Linear(config.x_size, config.hidden_size)
     self.res_y = torch.nn.Linear(config.x_size, config.y_size)
     self.cls_y = torch.nn.Linear(config.hidden_size, config.y_size)
     self.init_weights()
    def __init__(self, config):
        super(MethodGraphBertNodeConstruct, self).__init__(config)
        self.place = torch.device('cuda:0')

        self.config = config
        self.bert = MethodGraphBert(config).to(device=self.place)
        self.cls_y = torch.nn.Linear(config.hidden_size, config.x_size).to(device=self.place)
        self.init_weights()
 def __init__(self, config, pretrained_path):
     super(MethodGraphBertGraphRecovery, self).__init__(config)
     self.place = torch.device('cuda:0')
     self.config = config
     self.bert = MethodGraphBert(config).to(self.place)
     if pretrained_path is not None:
         print("Load pretraiend model from {}".format(pretrained_path))
         self.bert.from_pretrained(pretrained_path).to(self.place)
     self.init_weights()
    def __init__(self, config, pretrained_path, dataset_name):
        super(MethodGraphBertNodeClassification, self).__init__(config)
        self.place = torch.device('cuda:0')
        self.config = config
        self.bert = MethodGraphBert(config).to(device=self.place)
        # load from pretrained model if necessary
        if pretrained_path is not None:
            self.bert = self.bert.from_pretrained(pretrained_path).to(device=self.place)
        self.res_h = torch.nn.Linear(config.x_size, config.hidden_size).to(device=self.place)
        self.res_y = torch.nn.Linear(config.x_size, config.y_size).to(device=self.place)
        self.cls_y = torch.nn.Linear(config.hidden_size, config.y_size).to(device=self.place)
        self.init_weights()

        self.evaluator = Evaluator(dataset_name)
Exemple #5
0
 def __init__(self, config, pretrained_path):
     super(MethodGraphBertNodeClassification, self).__init__(config)
     self.device = torch.device('cuda:0')
     self.config = config
     self.bert = MethodGraphBert(config).to(self.device)
     if pretrained_path is not None:
         print("Load pretrained model from {}".format(pretrained_path))
         self.bert.from_pretrained(pretrained_path).to(self.device)
     self.res_h = torch.nn.Linear(config.x_size,
                                  config.hidden_size).to(self.device)
     self.res_y = torch.nn.Linear(config.x_size,
                                  config.y_size).to(self.device)
     self.cls_y = torch.nn.Linear(config.hidden_size,
                                  config.y_size).to(self.device)
     self.init_weights()
 def __init__(self, config):
     super(MethodGraphBertGraphClustering, self).__init__(config)
     self.config = config
     self.bert = MethodGraphBert(config)
     self.init_weights()
Exemple #7
0
 def __init__(self, config):
     super(MethodGraphBertGraphRecovery, self).__init__(config)
     self.config = config
     self.bert = MethodGraphBert(config)
     self.init_weights()