[ { "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" } ] } ]