File size: 9,982 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
[
  {
    "function_name": "MyModel.__init__",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "super().__init__",
        "functionality": "Initializes the parent class (nn.Module).",
        "input": "",
        "output": "",
        "location_or_namespace": "torch.nn.Module"
      },
      {
        "function_call_name": "nn.PReLU",
        "functionality": "Creates a PReLU activation layer.",
        "input": "",
        "output": "PReLU layer object",
        "location_or_namespace": "torch.nn"
      },
      {
        "function_call_name": "self._build_up",
        "functionality": "Helper function to build GCN and fully connected layers.",
        "input": "in_channels, out_channels, num_proj_hidden, temperature",
        "output": "",
        "location_or_namespace": "Provided_Code"
      }
    ]
  },
  {
    "function_name": "MyModel.forward",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "self.activation",
        "functionality": "Applies the activation function (e.g., PReLU).",
        "input": "tensor",
        "output": "tensor",
        "location_or_namespace": "torch.nn.modules.activation"
      },
      {
        "function_call_name": "self.conv1",
        "functionality": "Applies the first GCN layer.",
        "input": "x, edge_index",
        "output": "tensor",
        "location_or_namespace": "torch_geometric.nn.conv.GCNConv"
      },
      {
        "function_call_name": "self.conv2",
        "functionality": "Applies the second GCN layer.",
        "input": "out, edge_index",
        "output": "tensor",
        "location_or_namespace": "torch_geometric.nn.conv.GCNConv"
      },
      {
        "function_call_name": "F.relu",
        "functionality": "Applies the ReLU activation function.",
        "input": "tensor",
        "output": "tensor",
        "location_or_namespace": "torch.nn.functional"
      },
      {
        "function_call_name": "self.fc1",
        "functionality": "Applies the first fully connected layer.",
        "input": "out",
        "output": "tensor",
        "location_or_namespace": "torch.nn.modules.linear.Linear"
      },
      {
        "function_call_name": "self.fc2",
        "functionality": "Applies the second fully connected layer.",
        "input": "proj",
        "output": "tensor",
        "location_or_namespace": "torch.nn.modules.linear.Linear"
      }
    ]
  },
  {
    "function_name": "MyModel.loss",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "self.cal_loss",
        "functionality": "Calculates one direction of the contrastive loss.",
        "input": "z1, z2, batch_compute, batch_size",
        "output": "tensor",
        "location_or_namespace": "Provided_Code"
      },
      {
        "function_call_name": "l.mean",
        "functionality": "Computes the mean of the loss tensor.",
        "input": "",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      }
    ]
  },
  {
    "function_name": "MyModel.cal_sim",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "F.normalize",
        "functionality": "Normalizes the input tensor.",
        "input": "tensor",
        "output": "tensor",
        "location_or_namespace": "torch.nn.functional"
      },
      {
        "function_call_name": "z2.t",
        "functionality": "Transposes the tensor z2.",
        "input": "",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "torch.mm",
        "functionality": "Performs matrix multiplication.",
        "input": "z1, z2_transposed",
        "output": "tensor",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "torch.exp",
        "functionality": "Computes the exponential of each element in the input tensor.",
        "input": "tensor",
        "output": "tensor",
        "location_or_namespace": "torch"
      }
    ]
  },
  {
    "function_name": "MyModel.cal_loss",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "z1.device",
        "functionality": "Gets the device of the tensor z1.",
        "input": "",
        "output": "device object",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "z1.size",
        "functionality": "Gets the size of the tensor z1.",
        "input": "0",
        "output": "int",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "torch.arange",
        "functionality": "Creates a 1-D tensor of integers from 0 to num_nodes-1.",
        "input": "0, num_nodes",
        "output": "tensor",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "indices.to",
        "functionality": "Moves the tensor to the specified device.",
        "input": "device",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "torch.randperm",
        "functionality": "Creates a random permutation of integers from 0 to num_nodes-1.",
        "input": "num_nodes",
        "output": "tensor",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "range",
        "functionality": "Generates a sequence of numbers for iteration.",
        "input": "num_batches",
        "output": "iterator",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "self.cal_sim",
        "functionality": "Calculates the similarity matrix between two sets of embeddings.",
        "input": "tensor1, tensor2",
        "output": "tensor",
        "location_or_namespace": "Provided_Code"
      },
      {
        "function_call_name": "losses.append",
        "functionality": "Appends an element to the list.",
        "input": "tensor",
        "output": "",
        "location_or_namespace": "builtins.list"
      },
      {
        "function_call_name": "torch.log",
        "functionality": "Computes the natural logarithm of each element in the input tensor.",
        "input": "tensor",
        "output": "tensor",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "tensor.diag",
        "functionality": "Gets the diagonal elements of the tensor.",
        "input": "",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "tensor.sum",
        "functionality": "Computes the sum of elements in the tensor along a dimension.",
        "input": "1",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "torch.cat",
        "functionality": "Concatenates a sequence of tensors.",
        "input": "losses",
        "output": "tensor",
        "location_or_namespace": "torch"
      }
    ]
  },
  {
    "function_name": "MyModel._build_up",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "GCNConv",
        "functionality": "Creates a Graph Convolutional Network layer.",
        "input": "in_channels, out_channels",
        "output": "GCNConv layer object",
        "location_or_namespace": "torch_geometric.nn"
      },
      {
        "function_call_name": "nn.Linear",
        "functionality": "Creates a linear transformation layer.",
        "input": "in_features, out_features",
        "output": "Linear layer object",
        "location_or_namespace": "torch.nn"
      }
    ]
  },
  {
    "function_name": "MyModel.freeze",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "self.parameters",
        "functionality": "Returns an iterator over module parameters.",
        "input": "",
        "output": "iterator",
        "location_or_namespace": "torch.nn.Module"
      }
    ]
  },
  {
    "function_name": "LinearClassifier.__init__",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "super().__init__",
        "functionality": "Initializes the parent class (nn.Module).",
        "input": "",
        "output": "",
        "location_or_namespace": "torch.nn.Module"
      },
      {
        "function_call_name": "nn.Linear",
        "functionality": "Creates a linear transformation layer.",
        "input": "feat_dim, classes_num",
        "output": "Linear layer object",
        "location_or_namespace": "torch.nn"
      }
    ]
  },
  {
    "function_name": "LinearClassifier.weights_init",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "isinstance",
        "functionality": "Checks if an object is an instance of a class.",
        "input": "m, nn.Linear",
        "output": "bool",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "nn.init.xavier_uniform_",
        "functionality": "Fills the input Tensor with values according to the method described in 'Understanding the difficulty of training deep feedforward neural networks'.",
        "input": "m.weight.data",
        "output": "tensor",
        "location_or_namespace": "torch.nn.init"
      },
      {
        "function_call_name": "m.bias.data.fill_",
        "functionality": "Fills the tensor with the specified value.",
        "input": "0.0",
        "output": "tensor",
        "location_or_namespace": "torch.Tensor"
      }
    ]
  },
  {
    "function_name": "LinearClassifier.forward",
    "file_path": "Provided_Code",
    "function_calls": [
      {
        "function_call_name": "self.fc",
        "functionality": "Applies the fully connected layer.",
        "input": "x",
        "output": "tensor",
        "location_or_namespace": "torch.nn.modules.linear.Linear"
      }
    ]
  }
]