RECODE-H / annotations /annotation_28 /function_info.json
mcy98's picture
Upload folder using huggingface_hub
e89a301 verified
Raw History Blame Contribute Delete
25.8 kB
[
{
"function_name": "FlattenHead.__init__",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (torch.nn.Module).",
"input": "()",
"output": "None",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "torch.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": "torch.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": "torch.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/TimeXer.py",
"function_calls": [
{
"function_call_name": "self.flatten",
"functionality": "Flattens the input tensor starting from a specified dimension.",
"input": "x (tensor)",
"output": "Flattened tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.Flatten instance)"
},
{
"function_call_name": "self.linear",
"functionality": "Applies a linear transformation to the input tensor.",
"input": "x (tensor)",
"output": "Transformed tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.Linear instance)"
},
{
"function_call_name": "self.dropout",
"functionality": "Applies dropout to the input tensor.",
"input": "x (tensor)",
"output": "Tensor with dropout applied",
"location_or_namespace": "self_defined_module.py (torch.nn.Dropout instance)"
}
]
},
{
"function_name": "EnEmbedding.__init__",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (torch.nn.Module).",
"input": "()",
"output": "None",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "torch.nn.Linear",
"functionality": "Applies a linear transformation to the incoming data.",
"input": "patch_len, d_model, bias=False",
"output": "Linear layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "torch.randn",
"functionality": "Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1.",
"input": "1, n_vars, 1, d_model",
"output": "Tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "torch.nn.Parameter",
"functionality": "A kind of Tensor that is to be considered a module parameter.",
"input": "tensor (from torch.randn)",
"output": "Parameter object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "PositionalEmbedding",
"functionality": "Generates positional encodings for input sequences.",
"input": "d_model",
"output": "PositionalEmbedding layer object",
"location_or_namespace": "layers.Embed"
},
{
"function_call_name": "torch.nn.Dropout",
"functionality": "During training, randomly zeroes some of the elements of the input tensor with probability p.",
"input": "dropout",
"output": "Dropout layer object",
"location_or_namespace": "torch.nn"
}
]
},
{
"function_name": "EnEmbedding.forward",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "tensor.repeat",
"functionality": "Repeats this tensor along the specified dimensions.",
"input": "(x.shape[0], 1, 1, 1) (dimensions for repetition)",
"output": "Repeated tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "tensor.unfold",
"functionality": "Returns a view of the original tensor which contains all slices of size from self tensor in the dimension.",
"input": "dimension=-1, size=self.patch_len, step=self.patch_len",
"output": "Unfolded 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": "input_tensor, shape_tuple",
"output": "Reshaped tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.value_embedding",
"functionality": "Applies a linear transformation for value embedding.",
"input": "x (tensor of patches)",
"output": "Embedded tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.Linear instance)"
},
{
"function_call_name": "self.position_embedding",
"functionality": "Adds positional encoding to the input tensor.",
"input": "x (tensor of patches)",
"output": "Tensor with positional encoding",
"location_or_namespace": "self_defined_module.py (PositionalEmbedding instance)"
},
{
"function_call_name": "torch.cat",
"functionality": "Concatenates the given sequence of seq tensors in the given dimension.",
"input": "[x, glb] (list of tensors), dim=2",
"output": "Concatenated tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.dropout",
"functionality": "Applies dropout to the input tensor.",
"input": "x (tensor)",
"output": "Tensor with dropout applied, n_vars (integer)",
"location_or_namespace": "self_defined_module.py (torch.nn.Dropout instance)"
}
]
},
{
"function_name": "Encoder.__init__",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (torch.nn.Module).",
"input": "()",
"output": "None",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "torch.nn.ModuleList",
"functionality": "Holds submodules in a list.",
"input": "layers (list of nn.Module)",
"output": "ModuleList object",
"location_or_namespace": "torch.nn"
}
]
},
{
"function_name": "Encoder.forward",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "layer",
"functionality": "Applies an encoder layer transformation (self-attention, cross-attention, feed-forward).",
"input": "x, cross, x_mask=x_mask, cross_mask=cross_mask, tau=tau, delta=delta",
"output": "Transformed tensor x",
"location_or_namespace": "self_defined_module.py (EncoderLayer instance)"
},
{
"function_call_name": "self.norm",
"functionality": "Applies layer normalization to the input tensor.",
"input": "x (tensor)",
"output": "Normalized tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.LayerNorm instance or None)"
},
{
"function_call_name": "self.projection",
"functionality": "Applies a projection (e.g., linear layer) to the input tensor.",
"input": "x (tensor)",
"output": "Projected tensor",
"location_or_namespace": "self_defined_module.py (nn.Module instance or None)"
}
]
},
{
"function_name": "EncoderLayer.__init__",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (torch.nn.Module).",
"input": "()",
"output": "None",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "torch.nn.Conv1d",
"functionality": "Applies a 1D convolution over an input signal composed of several input planes.",
"input": "in_channels, out_channels, kernel_size=1",
"output": "Conv1d layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "torch.nn.LayerNorm",
"functionality": "Applies Layer Normalization over a mini-batch of inputs.",
"input": "d_model",
"output": "LayerNorm layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "torch.nn.Dropout",
"functionality": "During training, randomly zeroes some of the elements of the input tensor with probability p.",
"input": "dropout",
"output": "Dropout layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "torch.nn.functional.relu",
"functionality": "Applies the rectified linear unit function element-wise.",
"input": "input_tensor",
"output": "Output tensor",
"location_or_namespace": "torch.nn.functional"
},
{
"function_call_name": "torch.nn.functional.gelu",
"functionality": "Applies the Gaussian Error Linear Units function element-wise.",
"input": "input_tensor",
"output": "Output tensor",
"location_or_namespace": "torch.nn.functional"
}
]
},
{
"function_name": "EncoderLayer.forward",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "self.dropout",
"functionality": "Applies dropout to the input tensor.",
"input": "input_tensor",
"output": "Tensor with dropout applied",
"location_or_namespace": "self_defined_module.py (torch.nn.Dropout instance)"
},
{
"function_call_name": "self.self_attention",
"functionality": "Performs self-attention on the input tensor.",
"input": "query=x, key=x, value=x, attn_mask=x_mask, tau=tau, delta=None",
"output": "Tuple (attention_output, attention_weights)",
"location_or_namespace": "self_defined_module.py (AttentionLayer instance)"
},
{
"function_call_name": "self.norm1",
"functionality": "Applies layer normalization.",
"input": "x (tensor)",
"output": "Normalized tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.LayerNorm instance)"
},
{
"function_call_name": "tensor.unsqueeze",
"functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
"input": "dim (integer)",
"output": "Tensor with an added dimension",
"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": "input_tensor, shape_tuple",
"output": "Reshaped tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.cross_attention",
"functionality": "Performs cross-attention between two input tensors.",
"input": "query=x_glb, key=cross, value=cross, attn_mask=cross_mask, tau=tau, delta=delta",
"output": "Tuple (attention_output, attention_weights)",
"location_or_namespace": "self_defined_module.py (AttentionLayer instance)"
},
{
"function_call_name": "self.norm2",
"functionality": "Applies layer normalization.",
"input": "x_glb (tensor)",
"output": "Normalized tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.LayerNorm instance)"
},
{
"function_call_name": "torch.cat",
"functionality": "Concatenates the given sequence of seq tensors in the given dimension.",
"input": "list_of_tensors, dim (integer)",
"output": "Concatenated tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.activation",
"functionality": "Applies an activation function (ReLU or GeLU).",
"input": "input_tensor",
"output": "Activated tensor",
"location_or_namespace": "torch.nn.functional"
},
{
"function_call_name": "tensor.transpose",
"functionality": "Returns a tensor that is a transposed version of input.",
"input": "dim0, dim1 (integers)",
"output": "Transposed tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "self.conv1",
"functionality": "Applies a 1D convolution.",
"input": "input_tensor",
"output": "Convolved tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.Conv1d instance)"
},
{
"function_call_name": "self.conv2",
"functionality": "Applies a 1D convolution.",
"input": "input_tensor",
"output": "Convolved tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.Conv1d instance)"
},
{
"function_call_name": "self.norm3",
"functionality": "Applies layer normalization.",
"input": "x + y (tensor)",
"output": "Normalized tensor",
"location_or_namespace": "self_defined_module.py (torch.nn.LayerNorm instance)"
}
]
},
{
"function_name": "Model.__init__",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "super().__init__",
"functionality": "Initializes the parent class (torch.nn.Module).",
"input": "()",
"output": "None",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "int",
"functionality": "Converts a number or string to an integer.",
"input": "value (float from division)",
"output": "Integer",
"location_or_namespace": "Python built-in"
},
{
"function_call_name": "EnEmbedding",
"functionality": "Initializes the endogenous embedding layer.",
"input": "self.n_vars, configs.d_model, self.patch_len, configs.dropout",
"output": "EnEmbedding object",
"location_or_namespace": "self_defined_module.py"
},
{
"function_call_name": "DataEmbedding_inverted",
"functionality": "Embeds input data, potentially with inverted dimensions for channel-first processing or specific variate embedding for exogenous variables.",
"input": "configs.seq_len, configs.d_model, configs.embed, configs.freq, configs.dropout",
"output": "DataEmbedding_inverted object",
"location_or_namespace": "layers.Embed"
},
{
"function_call_name": "Encoder",
"functionality": "Initializes the Transformer encoder.",
"input": "list_of_encoder_layers, norm_layer=torch.nn.LayerNorm(configs.d_model)",
"output": "Encoder object",
"location_or_namespace": "self_defined_module.py"
},
{
"function_call_name": "EncoderLayer",
"functionality": "Initializes an encoder layer.",
"input": "self_attention_layer, cross_attention_layer, configs.d_model, configs.d_ff, dropout=configs.dropout, activation=configs.activation",
"output": "EncoderLayer object",
"location_or_namespace": "self_defined_module.py"
},
{
"function_call_name": "AttentionLayer",
"functionality": "A layer that applies an attention mechanism and projects the output.",
"input": "attention_mechanism (FullAttention instance), configs.d_model, configs.n_heads",
"output": "AttentionLayer object",
"location_or_namespace": "layers.SelfAttention_Family"
},
{
"function_call_name": "FullAttention",
"functionality": "Implements a standard scaled dot-product attention mechanism.",
"input": "False, configs.factor, attention_dropout=configs.dropout, output_attention=False",
"output": "FullAttention object",
"location_or_namespace": "layers.SelfAttention_Family"
},
{
"function_call_name": "torch.nn.LayerNorm",
"functionality": "Applies Layer Normalization over a mini-batch of inputs.",
"input": "configs.d_model",
"output": "LayerNorm layer object",
"location_or_namespace": "torch.nn"
},
{
"function_call_name": "FlattenHead",
"functionality": "Initializes the prediction head which flattens and projects features.",
"input": "configs.enc_in, self.head_nf, configs.pred_len, head_dropout=configs.dropout",
"output": "FlattenHead object",
"location_or_namespace": "self_defined_module.py"
},
{
"function_call_name": "range",
"functionality": "Generates a sequence of numbers.",
"input": "configs.e_layers",
"output": "Range iterator",
"location_or_namespace": "Python built-in"
}
]
},
{
"function_name": "Model.forecast",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "tensor.mean",
"functionality": "Computes the mean of elements across a dimension.",
"input": "dim=1, keepdim=True",
"output": "Tensor with mean values",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "tensor.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": "input_tensor, 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": "input_tensor",
"output": "Tensor with square-root values",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.en_embedding",
"functionality": "Applies endogenous embedding to the input tensor.",
"input": "processed_x_enc (tensor)",
"output": "Tuple (embedded_tensor, n_vars)",
"location_or_namespace": "self_defined_module.py (EnEmbedding instance)"
},
{
"function_call_name": "tensor.unsqueeze",
"functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
"input": "dim (integer)",
"output": "Tensor with an added dimension",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "tensor.permute",
"functionality": "Returns a view of the original tensor with its dimensions permuted.",
"input": "dims_tuple (e.g., 0, 2, 1)",
"output": "Permuted tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "self.ex_embedding",
"functionality": "Applies exogenous embedding to the input tensor.",
"input": "processed_x_enc (tensor), x_mark_enc (tensor)",
"output": "Embedded tensor",
"location_or_namespace": "self_defined_module.py (DataEmbedding_inverted instance)"
},
{
"function_call_name": "self.encoder",
"functionality": "Passes data through the Transformer encoder.",
"input": "en_embed (tensor), ex_embed (tensor)",
"output": "Encoded tensor",
"location_or_namespace": "self_defined_module.py (Encoder instance)"
},
{
"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": "input_tensor, shape_tuple",
"output": "Reshaped tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.head",
"functionality": "Applies the prediction head to the encoded features.",
"input": "enc_out (tensor)",
"output": "Forecast tensor (dec_out)",
"location_or_namespace": "self_defined_module.py (FlattenHead instance)"
},
{
"function_call_name": "tensor.repeat",
"functionality": "Repeats this tensor along the specified dimensions.",
"input": "dims_tuple (e.g., 1, self.pred_len, 1)",
"output": "Repeated tensor",
"location_or_namespace": "torch.Tensor"
}
]
},
{
"function_name": "Model.forecast_multi",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "tensor.mean",
"functionality": "Computes the mean of elements across a dimension.",
"input": "dim=1, keepdim=True",
"output": "Tensor with mean values",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "tensor.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": "input_tensor, 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": "input_tensor",
"output": "Tensor with square-root values",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.en_embedding",
"functionality": "Applies endogenous embedding to the input tensor.",
"input": "permuted_x_enc (tensor)",
"output": "Tuple (embedded_tensor, n_vars)",
"location_or_namespace": "self_defined_module.py (EnEmbedding instance)"
},
{
"function_call_name": "tensor.permute",
"functionality": "Returns a view of the original tensor with its dimensions permuted.",
"input": "dims_tuple (e.g., 0, 2, 1)",
"output": "Permuted tensor",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "self.ex_embedding",
"functionality": "Applies exogenous embedding to the input tensor.",
"input": "x_enc (tensor), x_mark_enc (tensor)",
"output": "Embedded tensor",
"location_or_namespace": "self_defined_module.py (DataEmbedding_inverted instance)"
},
{
"function_call_name": "self.encoder",
"functionality": "Passes data through the Transformer encoder.",
"input": "en_embed (tensor), ex_embed (tensor)",
"output": "Encoded tensor",
"location_or_namespace": "self_defined_module.py (Encoder instance)"
},
{
"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": "input_tensor, shape_tuple",
"output": "Reshaped tensor",
"location_or_namespace": "torch"
},
{
"function_call_name": "self.head",
"functionality": "Applies the prediction head to the encoded features.",
"input": "enc_out (tensor)",
"output": "Forecast tensor (dec_out)",
"location_or_namespace": "self_defined_module.py (FlattenHead instance)"
},
{
"function_call_name": "tensor.unsqueeze",
"functionality": "Returns a new tensor with a dimension of size one inserted at the specified position.",
"input": "dim (integer)",
"output": "Tensor with an added dimension",
"location_or_namespace": "torch.Tensor"
},
{
"function_call_name": "tensor.repeat",
"functionality": "Repeats this tensor along the specified dimensions.",
"input": "dims_tuple (e.g., 1, self.pred_len, 1)",
"output": "Repeated tensor",
"location_or_namespace": "torch.Tensor"
}
]
},
{
"function_name": "Model.forward",
"file_path": "models/TimeXer.py",
"function_calls": [
{
"function_call_name": "self.forecast_multi",
"functionality": "Performs forecasting for multivariate features ('M').",
"input": "x_enc, x_mark_enc, x_dec, x_mark_dec",
"output": "Forecast tensor",
"location_or_namespace": "self_defined_module.py"
},
{
"function_call_name": "self.forecast",
"functionality": "Performs forecasting for single/mixed features (not 'M').",
"input": "x_enc, x_mark_enc, x_dec, x_mark_dec",
"output": "Forecast tensor",
"location_or_namespace": "self_defined_module.py"
}
]
}
]