File size: 11,305 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
[
  {
    "function_name": "Model.__init__",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "super",
        "functionality": "Calls the __init__ method of the parent class (nn.Module).",
        "input": "(Model, self)",
        "output": "An instance of the parent class, allowing its __init__ to be called.",
        "location_or_namespace": "builtins"
      },
      {
        "function_call_name": "torch.randn",
        "functionality": "Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1.",
        "input": "shape (e.g., (1, self.embed_size))",
        "output": "A tensor with random numbers.",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "torch.nn.Parameter",
        "functionality": "A kind of Tensor that is to be considered a module parameter. Parameters are Tensor subclasses, that have a very special property when used with Module s - when they’re assigned as Module attributes they are automatically added to the list of its parameters, and will appear e.g. in parameters() iterator.",
        "input": "data (Tensor), requires_grad (bool, default=True)",
        "output": "A Parameter tensor.",
        "location_or_namespace": "torch.nn"
      },
      {
        "function_call_name": "torch.nn.Sequential",
        "functionality": "A sequential container. Modules will be added to it in the order they are passed in the constructor. Alternatively, an ordered dict of modules can also be passed in.",
        "input": "*args (Modules) or an OrderedDict of Modules",
        "output": "A Sequential module.",
        "location_or_namespace": "torch.nn"
      },
      {
        "function_call_name": "torch.nn.Linear",
        "functionality": "Applies a linear transformation to the incoming data: y = xA^T + b.",
        "input": "in_features (int), out_features (int), bias (bool, default=True)",
        "output": "A Linear module.",
        "location_or_namespace": "torch.nn"
      },
      {
        "function_call_name": "torch.nn.LeakyReLU",
        "functionality": "Applies the Leaky Rectified Linear Unit function element-wise.",
        "input": "negative_slope (float, default=1e-2), inplace (bool, default=False)",
        "output": "A LeakyReLU module.",
        "location_or_namespace": "torch.nn"
      }
    ]
  },
  {
    "function_name": "Model.tokenEmb",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "x.permute",
        "functionality": "Permutes the dimensions of the input tensor.",
        "input": "dims (tuple of ints)",
        "output": "A tensor with permuted dimensions.",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "x.unsqueeze",
        "functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
        "input": "dim (int)",
        "output": "A new tensor with an added dimension.",
        "location_or_namespace": "torch.Tensor"
      }
    ]
  },
  {
    "function_name": "Model.MLP_temporal",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "torch.fft.rfft",
        "functionality": "Computes the one-dimensional discrete Fourier Transform of a real-valued input.",
        "input": "input (Tensor), n (int, optional), dim (int, default=-1), norm (str, optional)",
        "output": "A tensor containing the real-to-complex FFT of the input.",
        "location_or_namespace": "torch.fft"
      },
      {
        "function_call_name": "self.FreMLP",
        "functionality": "Internal function to apply frequency-domain MLP. It processes complex numbers by separately computing mappings for real and imaginary parts, applies activation, and then soft shrinkage.",
        "input": "B (int), nd (int), dimension (int), x (Tensor), r (Tensor), i (Tensor), rb (Tensor), ib (Tensor)",
        "output": "A complex tensor after FreMLP processing.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "torch.fft.irfft",
        "functionality": "Computes the inverse one-dimensional discrete Fourier Transform of a real-valued signal transformed by rfft.",
        "input": "input (Tensor), n (int, optional), dim (int, default=-1), norm (str, optional)",
        "output": "A tensor containing the inverse FFT of the input.",
        "location_or_namespace": "torch.fft"
      }
    ]
  },
  {
    "function_name": "Model.MLP_channel",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "x.permute",
        "functionality": "Permutes the dimensions of the input tensor.",
        "input": "dims (tuple of ints)",
        "output": "A tensor with permuted dimensions.",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "torch.fft.rfft",
        "functionality": "Computes the one-dimensional discrete Fourier Transform of a real-valued input.",
        "input": "input (Tensor), n (int, optional), dim (int, default=-1), norm (str, optional)",
        "output": "A tensor containing the real-to-complex FFT of the input.",
        "location_or_namespace": "torch.fft"
      },
      {
        "function_call_name": "self.FreMLP",
        "functionality": "Internal function to apply frequency-domain MLP. It processes complex numbers by separately computing mappings for real and imaginary parts, applies activation, and then soft shrinkage.",
        "input": "B (int), nd (int), dimension (int), x (Tensor), r (Tensor), i (Tensor), rb (Tensor), ib (Tensor)",
        "output": "A complex tensor after FreMLP processing.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "torch.fft.irfft",
        "functionality": "Computes the inverse one-dimensional discrete Fourier Transform of a real-valued signal transformed by rfft.",
        "input": "input (Tensor), n (int, optional), dim (int, default=-1), norm (str, optional)",
        "output": "A tensor containing the inverse FFT of the input.",
        "location_or_namespace": "torch.fft"
      }
    ]
  },
  {
    "function_name": "Model.FreMLP",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "torch.zeros",
        "functionality": "Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument size.",
        "input": "size (int... or tuple of ints), *, out (Tensor, optional), dtype (torch.dtype, optional), layout (torch.layout, optional), device (torch.device, optional), requires_grad (bool, optional)",
        "output": "A tensor filled with zeros.",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "torch.einsum",
        "functionality": "Sums the product of the elements of the input operands along dimensions specified by the Einstein summation convention.",
        "input": "equation (str), *operands (Tensor)",
        "output": "The resulting tensor from the Einstein summation.",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "torch.nn.functional.relu",
        "functionality": "Applies the rectified linear unit function element-wise.",
        "input": "input (Tensor), inplace (bool, default=False)",
        "output": "A tensor with ReLU applied.",
        "location_or_namespace": "torch.nn.functional"
      },
      {
        "function_call_name": "torch.stack",
        "functionality": "Concatenates a sequence of tensors along a new dimension.",
        "input": "tensors (sequence of Tensors), dim (int, default=0), *, out (Tensor, optional)",
        "output": "A tensor formed by stacking the input tensors.",
        "location_or_namespace": "torch"
      },
      {
        "function_call_name": "torch.nn.functional.softshrink",
        "functionality": "Applies the soft shrinkage function element-wise.",
        "input": "input (Tensor), lambd (float, default=0.5)",
        "output": "A tensor with soft shrinkage applied.",
        "location_or_namespace": "torch.nn.functional"
      },
      {
        "function_call_name": "torch.view_as_complex",
        "functionality": "Returns a view of the input tensor as a complex tensor. The input tensor must have a final dimension of size 2, representing the real and imaginary components.",
        "input": "input (Tensor)",
        "output": "A complex tensor.",
        "location_or_namespace": "torch"
      }
    ]
  },
  {
    "function_name": "Model.forecast",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "self.tokenEmb",
        "functionality": "Internal function for dimension extension of the input tensor.",
        "input": "x_enc (Tensor)",
        "output": "An embedded tensor.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "self.MLP_channel",
        "functionality": "Internal function for frequency channel learning.",
        "input": "x (Tensor), B (int), N (int), L (int)",
        "output": "A tensor after channel-wise frequency domain processing.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "self.MLP_temporal",
        "functionality": "Internal function for frequency temporal learning.",
        "input": "x (Tensor), B (int), N (int), L (int)",
        "output": "A tensor after temporal frequency domain processing.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "x.reshape",
        "functionality": "Returns a tensor with the same data and number of elements as input, but with the specified shape.",
        "input": "shape (tuple of ints or int...)",
        "output": "A reshaped tensor.",
        "location_or_namespace": "torch.Tensor"
      },
      {
        "function_call_name": "self.fc",
        "functionality": "The fully connected sequential layer defined in __init__.",
        "input": "input (Tensor)",
        "output": "Output tensor from the FFN.",
        "location_or_namespace": "torch.nn.Sequential"
      },
      {
        "function_call_name": "x.permute",
        "functionality": "Permutes the dimensions of the input tensor.",
        "input": "dims (tuple of ints)",
        "output": "A tensor with permuted dimensions.",
        "location_or_namespace": "torch.Tensor"
      }
    ]
  },
  {
    "function_name": "Model.forward",
    "file_path": "models/FreTS.py",
    "function_calls": [
      {
        "function_call_name": "self.forecast",
        "functionality": "Internal function to perform the main forecasting logic, including embedding, frequency learners, and projection.",
        "input": "x_enc (Tensor)",
        "output": "The forecasted tensor.",
        "location_or_namespace": "model.py"
      },
      {
        "function_call_name": "ValueError",
        "functionality": "Raises an exception when a function receives an argument of the right type but an inappropriate value.",
        "input": "message (str)",
        "output": "A ValueError exception object.",
        "location_or_namespace": "builtins"
      }
    ]
  }
]