MCPcopy Index your code

hub / github.com/GestaltCogTeam/BasicTS / functions

Functions713 in github.com/GestaltCogTeam/BasicTS

↓ 152 callersMethodsave
(self)
src/basicts/configs/base_config.py:289
↓ 26 callersMethodlaunch_training
Launches the training process. This method initializes the runner specified in the configuration, sets up logging, and start
src/basicts/launcher.py:19
↓ 14 callersMethodtrigger
(self, event_name: str, runner, *args, **kwargs)
src/basicts/runners/callback/callback.py:54
↓ 13 callersFunctionbuild_layer
Build layer. Args: layer (Callable | Tuple[Callable, Any]): Layer norm function or tuple of layer norm function and kwargs. Returns:
src/basicts/modules/transformer/utils.py:55
↓ 13 callersMethodregister_meter
(self, name, meter_type, fmt="{:f}", plt=True)
src/basicts/runners/basicts_runner.py:1177
↓ 13 callersMethodupdate_meter
(self, name, value, n=1)
src/basicts/runners/basicts_runner.py:1181
↓ 7 callersMethod_shape
(self, x: torch.Tensor, seq_len: int)
src/basicts/modules/transformer/attentions/auto_correlation.py:28
↓ 6 callersMethod_metric_forward
(self, metric_fn: Callable, forward_return: Dict[str, Any])
src/basicts/runners/basicts_runner.py:798
↓ 6 callersMethod_shape_kv
(self, x: torch.Tensor, seq_len: int)
src/basicts/modules/transformer/attentions/multi_head_attention.py:44
↓ 6 callersMethodffn_forward
Feed-forward network sublayer. Args: hidden_states (torch.Tensor): Input hidden states. **kwargs: Additional
src/basicts/modules/transformer/encoder.py:83
↓ 6 callersMethodplt_meters
(self, meter_type, step, value_type="avg")
src/basicts/runners/basicts_runner.py:1189
↓ 5 callersMethod__init__
(self, num_features: int, hidden_size: int)
src/basicts/modules/embed/tst_embed.py:48
↓ 5 callersMethod__init__
Args: decoder_layers (nn.ModuleList): The decoder layers. layer_norm (Optional[nn.Module], optional):
src/basicts/modules/transformer/decoder.py:630
↓ 5 callersMethod__init__
(self, f_in, f_out, hidden_dim=128, hidden
src/basicts/models/Koopa/arch/layers.py:31
↓ 5 callersMethod_shape
(self, x: torch.Tensor, seq_len: int)
src/basicts/models/NonstationaryTransformer/arch/ns_transformer_layers.py:27
↓ 5 callersMethodeval
The complete evaluation process. Args: ckpt_path (str, optional): Path to the model checkpoint file. Defaults to None.
src/basicts/runners/basicts_runner.py:342
↓ 5 callersMethodget_weight
Get the weight of the forward return
src/basicts/runners/taskflow/basicts_taskflow.py:24
↓ 5 callersMethodprint_meters
(self, meter_type)
src/basicts/runners/basicts_runner.py:1185
↓ 4 callersMethod__init__
(self, hidden_size: int, win_size: int)
src/basicts/models/Crossformer/arch/crossformer_layers.py:17
↓ 4 callersMethod_forward
Train model. Args: epoch (int): current epoch iter_index (int): current iter index data (Dict): data
src/basicts/runners/basicts_runner.py:756
↓ 4 callersMethod_pack_params
Pack params to the config and add the extra keys to `_keys_to_pop`. Args: params (dict): params obj_params (dict): pa
src/basicts/configs/base_config.py:262
↓ 4 callersMethodget_value
Get value. Args: name (str): meter name. Returns: avg (float)
src/basicts/utils/meter_pool.py:52
↓ 4 callersFunctionnull_val_mask
Create a mask for the input data. Args: data (torch.Tensor): Input data. mask_ratio (float): Ratio of the data to be masked.
src/basicts/utils/mask.py:5
↓ 4 callersMethodstep
(self)
src/basicts/runners/optim/optimizers.py:108
↓ 4 callersMethodtransform
Apply the scaling transformation to the input data. Args: input_data (torch.Tensor): Input data to be transformed.
src/basicts/scaler/base_scaler.py:33
↓ 4 callersMethodupdate
Updates the cache with the new `key_states` and `value_states` for the layer `layer_idx`. Parameters: key_states (`torch
src/basicts/modules/transformer/kv_cache.py:35
↓ 4 callersMethodupdate
Update average meter. Args: name (str): meter name. value (Union[float, Tuple[float]]): value. n: (int):
src/basicts/utils/meter_pool.py:41
↓ 3 callersMethod__init__
(self, kernel_size: int, stride: int)
src/basicts/modules/decomposition.py:18
↓ 3 callersMethod__init__
patch_len: int, patch len for patch_embedding stride: int, stride for patch_embedding
src/basicts/models/PatchTST/arch/patchtst_arch.py:27
↓ 3 callersMethod__init__
(self, config: MTSMixerConfig)
src/basicts/models/MTSMixer/arch/mtsmixer_layers.py:90
↓ 3 callersMethod__init__
(self, config: NonstationaryTransformerConfig)
src/basicts/models/NonstationaryTransformer/arch/ns_transformer_arch.py:27
↓ 3 callersMethod__init__
(self, config: iTransformerConfig)
src/basicts/models/iTransformer/arch/itransformer_arch.py:24
↓ 3 callersMethod__init__
(self, hidden_size: int, degree: int)
src/basicts/models/TimeKAN/arch/timekan_layers.py:189
↓ 3 callersMethod_build_data_loader
Build dataloader from BasicTSConfig structure of `data_cfg` is { 'BATCH_SIZE': (int, optional) batch size of data loader
src/basicts/runners/builder.py:71
↓ 3 callersMethod_mask_anomaly
Mask abnormal values in the sequence. Args: seq (np.ndarray): input sequence Returns: np.ndarray: s
src/basicts/data/blast.py:181
↓ 3 callersMethod_shape
Reshape input to (batch, heads, seq_len, head_dim).
src/basicts/modules/transformer/attentions/prob_attention.py:31
↓ 3 callersMethod_test
The complete test process. It should not be directly called. Args: train_epoch (int, optional): Current epoch during tra
src/basicts/runners/basicts_runner.py:371
↓ 3 callersFunctioncalculate_transition_matrix
Calculate the transition matrix as proposed in DCRNN and Graph WaveNet. The transition matrix is defined as P = D^{-1} A, where D is the deg
src/basicts/utils/adjacent_matrix_norm.py:85
↓ 3 callersMethodinit_logger
Initialize logger. Args: logger (logging.Logger, optional): specified logger. logger_name (str, optional): specified
src/basicts/runners/basicts_runner.py:1103
↓ 3 callersMethodinverse_transform
Apply the inverse scaling transformation to the input data. Args: input_data (torch.Tensor): Input data to be transforme
src/basicts/scaler/base_scaler.py:47
↓ 3 callersMethodpreprocess
Run the task flow
src/basicts/runners/taskflow/basicts_taskflow.py:12
↓ 3 callersMethodself_attn_forward
Self-attention sublayer. Args: hidden_states (torch.Tensor): Input hidden states. attention_mask (Optional[t
src/basicts/modules/transformer/encoder.py:37
↓ 2 callersMethod__init__
Initialize the Auto-Attention module. Args: d_model (int): The input and output dimension for queries, keys, and values.
src/basicts/models/Leddam/arch/leddam_layers.py:66
↓ 2 callersMethod__init__
( self, decoder_layers: nn.ModuleList, layer_norm: Optional[nn.Module] = N
src/basicts/models/Autoformer/arch/layers.py:162
↓ 2 callersMethod__init__
(self, input_size: int, output_size: int)
src/basicts/models/StemGNN/arch/stemgnn_arch.py:13
↓ 2 callersMethod__init__
(self, config: TimeMixerConfig)
src/basicts/models/TimeMixer/arch/mixing_layers.py:53
↓ 2 callersMethod__init__
(self, config: FiLMConfig)
src/basicts/models/FiLM/arch/film_arch.py:114
↓ 2 callersMethod__init__
Create a SparseDispatcher.
src/basicts/models/DUET/arch/linear_extractor_cluster.py:44
↓ 2 callersMethod_build_dataset
Build a dataset with the given config and mode. Args: cfg (BasicTSConfig): config mode (BasicTSMode): mode R
src/basicts/runners/builder.py:115
↓ 2 callersMethod_eval_loop
evaluate model.
src/basicts/runners/basicts_runner.py:487
↓ 2 callersMethod_get_ckpt_path
Get checkpoint path. The format is "{ckpt_save_dir}/{model_name}_{epoch}" Args: epoch (int): current epoch. Ret
src/basicts/runners/basicts_runner.py:1137
↓ 2 callersMethod_init_test
Initialize the test data loader and related settings. Args: cfg (BasicTSConfig): Configuration dictionary.
src/basicts/runners/basicts_runner.py:258
↓ 2 callersMethod_init_validation
Initialize validation
src/basicts/runners/basicts_runner.py:248
↓ 2 callersMethod_load_data
Load data from local file or remotely. Returns: np.ndarray: loaded data
src/basicts/data/blast.py:68
↓ 2 callersMethod_load_model
Load model state dict. if param `ckpt_path` is None, load the last checkpoint in `self.ckpt_save_dir`, else load checkpoint from `ckpt
src/basicts/runners/basicts_runner.py:904
↓ 2 callersMethod_normalize
Zscore normalize the inputs and targets. Args: inputs (np.ndarray): input sequences targets (Optional[np.nda
src/basicts/data/blast.py:155
↓ 2 callersMethod_process_levels
Common processing pipeline for frequency levels. Args: level_list: List of frequency levels (from high to low)
src/basicts/models/TimeKAN/arch/timekan_layers.py:75
↓ 2 callersMethod_rotate_half
Rotates half the hidden dims of the input.
src/basicts/modules/transformer/rope.py:59
↓ 2 callersMethod_save_best_model
Save the best model while training. Examples: >>> def on_validating_end(self, train_epoch: Optional[int]): >>> if
src/basicts/runners/basicts_runner.py:1016
↓ 2 callersMethod_save_model
Save checkpoint every epoch. checkpoint format is { "epoch": current epoch ([1, num_epochs]), "model_state_dict": sta
src/basicts/runners/basicts_runner.py:962
↓ 2 callersMethod_set_cos_sin_cache
(self, seq_len: int, device: torch.device)
src/basicts/modules/transformer/rope.py:65
↓ 2 callersFunctioncalculate_symmetric_normalized_laplacian
Calculate the symmetric normalized Laplacian. The symmetric normalized Laplacian matrix is given by: L^{Sym} = I - D^{-1/2} A D^{-1/2},
src/basicts/utils/adjacent_matrix_norm.py:6
↓ 2 callersMethodcross_attn_forward
Forward pass of the cross-attention layer. Args: hidden_states (torch.Tensor): The input hidden states.
src/basicts/modules/transformer/decoder.py:318
↓ 2 callersMethodcv_squared
The squared coefficient of variation of a sample. Useful as a loss to encourage a positive distribution to be more uniform. Epsilons a
src/basicts/models/DUET/arch/linear_extractor_cluster.py:184
↓ 2 callersMethodfit
Fit the scaler to the training data. Args: data (torch.Tensor): Training data used to fit the scaler.
src/basicts/scaler/base_scaler.py:23
↓ 2 callersFunctionfrequency_interpolation
(x, seq_len: int, target_len: int)
src/basicts/models/TimeKAN/arch/timekan_layers.py:171
↓ 2 callersFunctionget_file_dict
获取指定目录下指定后缀的文件字典 :param file_dir: 文件目录 :param postfix: 文件后缀 :param specify_dir_depth: 指定目录深度,0表示不指定 :param key_remain_length
server/engine/utils.py:8
↓ 2 callersMethodinference
(self, input_data: Union[list, str])
server/engine/engine.py:59
↓ 2 callersMethodload_data
Load and preprocess raw data, selecting the specified channel(s).
scripts/data_preparation/UEA/generate_training_data.py:71
↓ 2 callersFunctionload_pkl
Load data from a pickle file. Args: pickle_file (str): Path to the pickle file. Returns: object: Loaded object from the
src/basicts/utils/serialization.py:44
↓ 2 callersMethodpostprocess
Run the task flow
src/basicts/runners/taskflow/basicts_taskflow.py:18
↓ 2 callersFunctionprepare_causal_attention_mask
Generate a causal attention mask (including padding mask) for the decoder. Args: input_shape: (batch_size, seq_len) inpu
src/basicts/modules/transformer/utils.py:7
↓ 2 callersMethodpreprocess_data
(self, inputs, labels, seq_len, is_train)
scripts/data_preparation/UEA/generate_training_data.py:79
↓ 2 callersMethodreset_meters
(self)
src/basicts/runners/basicts_runner.py:1193
↓ 2 callersMethodrun
(self)
scripts/data_preparation/UEA/generate_training_data.py:26
↓ 2 callersMethodtrain
(self)
src/basicts/runners/basicts_runner.py:303
↓ 2 callersMethodvalidate
Validate model. Args: cfg (Dict, optional): config train_epoch (int, optional): current epoch if in training process.
src/basicts/runners/basicts_runner.py:320
↓ 1 callersMethod__init__
Initialize the MLP layer. Args: input_size (int): Input feature dimension. intermediate_size (int): Hidden d
src/basicts/modules/mlps.py:12
↓ 1 callersMethod__init__
( self, encoder_layers: nn.ModuleList, layer_norm: Optional[nn.Module] = None, )
src/basicts/modules/transformer/encoder.py:156
↓ 1 callersMethod__init__
(self, optimizer: Optimizer, num_warmup_steps: int, num_training_steps: int, num_cycles: float = 0.5, last_ep
src/basicts/runners/optim/lr_schedulers.py:36
↓ 1 callersMethod__init__
(self, params, lr=0.02, momentum=0.95, nesterov=True, backend='newtonschulz5', backend_steps=5)
src/basicts/runners/optim/optimizers.py:75
↓ 1 callersMethod__init__
(self, nf, target_window, dropout = 0)
src/basicts/models/TimeXer/arch/layers.py:13
↓ 1 callersMethod__init__
(self, config: TimesNetConfig)
src/basicts/models/TimesNet/arch/timesnet_arch.py:19
↓ 1 callersMethod__init__
( self, in_channels: int, out_channels: int, num_kernels:
src/basicts/models/TimesNet/arch/conv_block.py:9
↓ 1 callersMethod__init__
(self, config: TimeMixerConfig)
src/basicts/models/TimeMixer/arch/timemixer_arch.py:22
↓ 1 callersMethod__init__
( self, input_size: int, output_size: int, individual: bool =
src/basicts/models/PatchTST/arch/patchtst_layers.py:24
↓ 1 callersMethod__init__
( self, input_size: int, intermediate_size: int, output_size:
src/basicts/models/LightTS/arch/lightts_arch.py:13
↓ 1 callersMethod__init__
(self, config: FreTSConfig)
src/basicts/models/FreTS/arch/frets_arch.py:20
↓ 1 callersMethod__init__
(self, config: TiDEConfig)
src/basicts/models/TiDE/arch/tide_arch.py:50
↓ 1 callersMethod__init__
( self, num_features: int, input_size: int, hidden_size: int,
src/basicts/models/NonstationaryTransformer/arch/ns_transformer_layers.py:220
↓ 1 callersMethod__post_init__
(self)
src/basicts/configs/tsi_config.py:262
↓ 1 callersMethod_bernoulli_gumbel_rsample
(self, dist_matrix: torch.Tensor)
src/basicts/models/DUET/arch/mahalanobis_mask.py:43
↓ 1 callersMethod_build_lr_scheduler
(cfg: "BasicTSConfig", optimizer: torch.optim.Optimizer)
src/basicts/runners/builder.py:148
↓ 1 callersMethod_build_model
Build model. Initialize model by calling ```self.define_model```, Moves model to the GPU. If DDP is initialized, initialize
src/basicts/runners/builder.py:31
↓ 1 callersMethod_build_optimizer
(cfg: "BasicTSConfig", model: torch.nn.Module)
src/basicts/runners/builder.py:144
↓ 1 callersMethod_build_scaler
(cfg: "BasicTSConfig")
src/basicts/runners/builder.py:152
↓ 1 callersMethod_calculate_prob_distance
(self, x)
src/basicts/models/DUET/arch/mahalanobis_mask.py:22
↓ 1 callersMethod_check_required_callbacks
Check required callbacks.
src/basicts/runners/basicts_runner.py:1153
↓ 1 callersMethod_compute_entropy
Compute the residual entropy for time series. This is an implementation for residual that follows a normal distribution. Arg
src/basicts/runners/callback/selective_learning.py:132
↓ 1 callersMethod_construct_obj
(cls, obj: object)
src/basicts/configs/base_config.py:244
next →1–100 of 713, ranked by callers