File size: 6,681 Bytes
6077218 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | [
{
"function_name": "HomoGCL.__init__",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "__init__",
"functionality": "Initializes the parent nn.Module class.",
"input": "self (implicit)",
"output": "None",
"location_or_namespace": "torch.nn.Module"
},
{
"function_call_name": "GCN",
"functionality": "Initializes a Graph Convolutional Network model object.",
"input": "in_dim, hid_dim, out_dim, n_layers",
"output": "GCN model instance",
"location_or_namespace": "gcn_module.py"
},
{
"function_call_name": "Linear",
"functionality": "Creates a linear transformation layer (y = xA^T + b).",
"input": "in_features, out_features, bias=True",
"output": "torch.nn.Linear instance",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "GraphConv",
"functionality": "Creates a Graph Convolutional layer from DGL.",
"input": "in_feats, out_feats, norm='both', weight=True, bias=True, activation=None, allow_zero_in_degree=False",
"output": "dgl.nn.pytorch.GraphConv instance",
"location_or_namespace": "dgl.nn"
}
]
},
{
"function_name": "HomoGCL.posaug",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "self.neighboraggr",
"functionality": "Applies graph convolution to input features using the pre-initialized GraphConv layer.",
"input": "graph, x, edge_weight=edge_weight",
"output": "Tensor containing the new node representations",
"location_or_namespace": "dgl.nn.GraphConv"
}
]
},
{
"function_name": "HomoGCL.forward",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "self.encoder",
"functionality": "Encodes graph features using the GCN model to produce node embeddings.",
"input": "graph, features (e.g., graph1, feat1)",
"output": "Tensor of node embeddings",
"location_or_namespace": "gcn_module.py"
}
]
},
{
"function_name": "HomoGCL.projection",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "self.fc1",
"functionality": "Applies the first linear transformation of the projection head.",
"input": "z (input tensor)",
"output": "Transformed tensor",
"location_or_namespace": "torch.nn.Linear"
},
{
"function_call_name": "elu",
"functionality": "Applies the Exponential Linear Unit activation function.",
"input": "input_tensor, alpha=1.0, inplace=False",
"output": "Tensor with ELU applied",
"location_or_namespace": "torch.nn.functional"
},
{
"function_call_name": "self.fc2",
"functionality": "Applies the second linear transformation of the projection head.",
"input": "input_tensor (output of ELU)",
"output": "Projected tensor",
"location_or_namespace": "torch.nn.Linear"
}
]
},
{
"function_name": "HomoGCL.semi_loss",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "sim",
"functionality": "Computes pairwise similarity between two input tensors of embeddings.",
"input": "tensor1, tensor2",
"output": "Similarity matrix (tensor)",
"location_or_namespace": "utils.py"
},
{
"function_call_name": "exp",
"functionality": "Computes the element-wise exponential of the input tensor.",
"input": "input_tensor",
"output": "Tensor with exponential applied",
"location_or_namespace": "torch"
},
{
"function_call_name": "diag",
"functionality": "Extracts the diagonal of a tensor or creates a diagonal tensor.",
"input": "input_tensor, diagonal=0",
"output": "Tensor containing the diagonal or a diagonal tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "sum",
"functionality": "Sums tensor elements along a given dimension.",
"input": "input_tensor, dim, keepdim=False, dtype=None",
"output": "Tensor with sums",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "log",
"functionality": "Computes the element-wise natural logarithm of the input tensor.",
"input": "input_tensor",
"output": "Tensor with natural logarithm applied",
"location_or_namespace": "torch"
}
]
},
{
"function_name": "HomoGCL.loss",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "self.projection",
"functionality": "Projects node embeddings into a new latent space using the projection head.",
"input": "z (embedding tensor)",
"output": "Projected embedding tensor",
"location_or_namespace": "homogcl_model.py"
},
{
"function_call_name": "self.semi_loss",
"functionality": "Computes a component of the contrastive loss based on similarities.",
"input": "z1, adj1, z2, adj2, confmatrix, mean",
"output": "Loss tensor for one direction",
"location_or_namespace": "homogcl_model.py"
},
{
"function_call_name": "mean",
"functionality": "Computes the mean of all elements in the input tensor.",
"input": "input_tensor, dtype=None",
"output": "Scalar tensor representing the mean",
"location_or_namespace": "torch.Tensor"
}
]
},
{
"function_name": "HomoGCL.get_embedding",
"file_path": "homogcl_model.py",
"function_calls": [
{
"function_call_name": "no_grad",
"functionality": "Context-manager that disables gradient calculation.",
"input": "None",
"output": "Context manager object",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.encoder",
"functionality": "Encodes graph features using the GCN model to produce node embeddings.",
"input": "graph, feat",
"output": "Tensor of node embeddings",
"location_or_namespace": "gcn_module.py"
},
{
"function_call_name": "detach",
"functionality": "Returns a new tensor, detached from the current computation graph.",
"input": "self (implicit input tensor)",
"output": "Detached tensor",
"location_or_namespace": "torch.Tensor"
}
]
}
] |