File size: 10,000 Bytes
2d13eb2 | 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 | [
{
"function_name": "Transpose.__init__",
"file_path": "models/PatchTST.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (nn.Module).",
"input": "",
"output": "",
"location_or_namespace": "torch.nn.Module"
}
]
},
{
"function_name": "Transpose.forward",
"file_path": "models/PatchTST.py",
"function_calls": [
{
"function_call_name": "x.transpose",
"functionality": "Transposes a tensor.",
"input": "*self.dims",
"output": "Transposed tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "x.transpose().contiguous",
"functionality": "Returns a contiguous tensor containing the same data as self tensor.",
"input": "",
"output": "Contiguous tensor",
"location_or_namespace": "torch.Tensor"
}
]
},
{
"function_name": "FlattenHead.__init__",
"file_path": "models/PatchTST.py",
"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.Flatten",
"functionality": "Flattens a contiguous range of dims into a tensor.",
"input": "start_dim=-2",
"output": "Flatten layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "nn.Linear",
"functionality": "Applies a linear transformation to the incoming data.",
"input": "nf, target_window",
"output": "Linear layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "nn.Dropout",
"functionality": "During training, randomly zeroes some of the elements of the input tensor with probability p.",
"input": "head_dropout",
"output": "Dropout layer object",
"location_or_namespace": "torch.nn"
}
]
},
{
"function_name": "FlattenHead.forward",
"file_path": "models/PatchTST.py",
"function_calls": []
},
{
"function_name": "Model.__init__",
"file_path": "models/PatchTST.py",
"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": "PatchEmbedding",
"functionality": "",
"input": "configs.d_model, patch_len, stride, padding, configs.dropout",
"output": "PatchEmbedding object",
"location_or_namespace": "layers.Embed.PatchEmbedding"
},
{
"function_call_name": "FullAttention",
"functionality": "",
"input": "False, configs.factor, attention_dropout=configs.dropout, output_attention=False",
"output": "FullAttention object",
"location_or_namespace": "layers.SelfAttention_Family.FullAttention"
},
{
"function_call_name": "AttentionLayer",
"functionality": "",
"input": "FullAttention_object, configs.d_model, configs.n_heads",
"output": "AttentionLayer object",
"location_or_namespace": "layers.SelfAttention_Family.AttentionLayer"
},
{
"function_call_name": "EncoderLayer",
"functionality": "",
"input": "AttentionLayer_object, configs.d_model, configs.d_ff, dropout=configs.dropout, activation=configs.activation",
"output": "EncoderLayer object",
"location_or_namespace": "layers.Transformer_EncDec.EncoderLayer"
},
{
"function_call_name": "range",
"functionality": "Generates a sequence of numbers.",
"input": "configs.e_layers",
"output": "Range object",
"location_or_namespace": "builtins"
},
{
"function_call_name": "Transpose",
"functionality": "Transposes input tensor.",
"input": "1, 2",
"output": "Transpose layer object",
"location_or_namespace": "main.Transpose"
},
{
"function_call_name": "nn.BatchNorm1d",
"functionality": "Applies Batch Normalization over a 2D or 3D input.",
"input": "configs.d_model",
"output": "BatchNorm1d layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "nn.Sequential",
"functionality": "A sequential container.",
"input": "Transpose_object, nn.BatchNorm1d_object, Transpose_object",
"output": "Sequential container object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "Encoder",
"functionality": "",
"input": "list_of_EncoderLayer_objects, norm_layer=nn.Sequential_object",
"output": "Encoder object",
"location_or_namespace": "layers.Transformer_EncDec.Encoder"
},
{
"function_call_name": "int",
"functionality": "Converts a number or string to an integer.",
"input": "(configs.seq_len - patch_len) / stride + 2",
"output": "Integer value",
"location_or_namespace": "builtins"
},
{
"function_call_name": "FlattenHead",
"functionality": "Flattens the head of the network and applies linear and dropout layers.",
"input": "configs.enc_in, self.head_nf, configs.pred_len, head_dropout=configs.dropout",
"output": "FlattenHead object",
"location_or_namespace": "main.FlattenHead"
},
{
"function_call_name": "nn.Flatten",
"functionality": "Flattens a contiguous range of dims into a tensor.",
"input": "start_dim=-2",
"output": "Flatten layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "nn.Dropout",
"functionality": "During training, randomly zeroes some of the elements of the input tensor with probability p.",
"input": "configs.dropout",
"output": "Dropout layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "nn.Linear",
"functionality": "Applies a linear transformation to the incoming data.",
"input": "self.head_nf * configs.enc_in, configs.num_class",
"output": "Linear layer object",
"location_or_namespace": "torch.nn"
}
]
},
{
"function_name": "Model.forecast",
"file_path": "models/PatchTST.py",
"function_calls": [
{
"function_call_name": "x_enc.mean",
"functionality": "Computes the mean of elements across a dimension.",
"input": "1, keepdim=True",
"output": "Tensor with mean values",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "means.detach",
"functionality": "Returns a new Tensor, detached from the current graph.",
"input": "",
"output": "Detached tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "torch.var",
"functionality": "Calculates the variance of all elements in the input tensor.",
"input": "x_enc, dim=1, keepdim=True, unbiased=False",
"output": "Tensor with variance values",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.sqrt",
"functionality": "Returns a new tensor with the square-root of the elements of input.",
"input": "torch.var_result + 1e-5",
"output": "Tensor with square root values",
"location_or_namespace": "torch"
},
{
"function_call_name": "x_enc.permute",
"functionality": "Returns a view of the original tensor input with its dimensions permuted.",
"input": "0, 2, 1",
"output": "Permuted tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "torch.reshape",
"functionality": "Returns a tensor with the same data and number of elements as input, but with the specified shape.",
"input": "enc_out, (-1, n_vars, enc_out.shape[-2], enc_out.shape[-1])",
"output": "Reshaped tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "stdev.unsqueeze",
"functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
"input": "1",
"output": "Unsqueezed tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "stdev_unsqueezed.repeat",
"functionality": "Repeats this tensor along the specified dimensions.",
"input": "1, self.pred_len, 1",
"output": "Repeated tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "means.unsqueeze",
"functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
"input": "1",
"output": "Unsqueezed tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "means_unsqueezed.repeat",
"functionality": "Repeats this tensor along the specified dimensions.",
"input": "1, self.pred_len, 1",
"output": "Repeated tensor",
"location_or_namespace": "torch.Tensor"
}
]
},
{
"function_name": "Model.forward",
"file_path": "models/PatchTST.py",
"function_calls": [
{
"function_call_name": "self.forecast",
"functionality": "Performs forecasting using the model.",
"input": "x_enc, x_mark_enc, x_dec, x_mark_dec",
"output": "Forecasted tensor",
"location_or_namespace": "main.Model"
}
]
}
] |