def __init__(self): super(Attacker, self).__init__() # 调用父类初始化 self.attack = False self.conv1 = GCNConv(CONFIG.FeatureLen(), 180) self.conv2 = GCNConv(180, 120) self.lin1 = torch.nn.Linear(120, CONFIG.ClassNum()) # 这次反而需要调整的参数是输入 self.X = torch.tensor([1], dtype=torch.float) self.edges = torch.tensor([[], []], dtype=torch.long)
def GetFeatures() -> np.matrix: features_ndarray = OpFile.ReadFeatures() features_matrix = features_ndarray.reshape( (len(features_ndarray), CONFIG.FeatureLen())) return features_matrix
def __init__(self, drop=0.5, conv1_hide=100, leaky=0.01): super(RPGGCN, self).__init__() # 调用父类 self.drop = drop # 在dropout操作中,元素被置为0的概率 self.leaky = leaky self.conv1 = GCNConv(CONFIG.FeatureLen(), conv1_hide) self.conv2 = GCNConv(conv1_hide, CONFIG.ClassNum())
def __init__(self): super(GCNClassifier, self).__init__() # 调用父类初始化 self.conv1 = GCNConv(CONFIG.FeatureLen(), 180) self.conv2 = GCNConv(180, 120) # self.conv3 = GCNConv(100, CONFIG.ClassNum()) self.lin1 = torch.nn.Linear(120, CONFIG.ClassNum())