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