cursus.steps.hyperparams.hyperparameters_dual_sequence_tsa¶
- class DualSequenceTSAHyperparameters(*, full_field_list, cat_field_list, tab_field_list, id_name, label_name, multiclass_categories, categorical_features_to_encode=<factory>, model_class='dual_sequence_tsa', device=-1, header=0, lr=3e-05, batch_size=2, eval_batch_size_multiplier=2.0, max_epochs=3, metric_choices=['f1_score', 'auroc'], optimizer='SGD', class_weights=None, n_embedding, n_cat_features, n_num_features, seq_len, seq_cat_key='x_seq_cat', seq_num_key='x_seq_num', seq_time_key='time_seq', engineered_key='x_engineered', dim_embedding_table=128, dim_attn_feedforward=512, num_heads=8, n_layers_order=2, n_layers_feature=2, dropout=0.1, use_moe=False, num_experts=4, expert_capacity_factor=1.25, expert_dropout=0.1, use_time_seq=True, time_encoding_dim=32, return_seq=False, use_key_padding_mask=True, loss='CrossEntropyLoss', loss_alpha=0.25, loss_gamma=2.0, loss_gamma_min=1.0, loss_gamma_max=3.0, loss_cycle_length=1000, loss_reduction='mean', weight_decay=0.0, adam_epsilon=1e-08, warmup_steps=300, run_scheduler=True, seq1_cat_key='x_seq_cat_primary', seq1_num_key='x_seq_num_primary', seq1_time_key='time_seq_primary', seq2_cat_key='x_seq_cat_secondary', seq2_num_key='x_seq_num_secondary', seq2_time_key='time_seq_secondary', gate_embedding_dim=16, gate_hidden_dim=256, gate_threshold=0.05)[source]¶
Bases:
TemporalSelfAttentionHyperparametersHyperparameters for Dual-Sequence Temporal Self-Attention (TSA) model training, extending TemporalSelfAttentionHyperparameters.
Adds support for dual-sequence processing with a gate function that dynamically weights the importance of primary vs secondary sequences.
Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private attributes with properties)
- property model_config_dict: Dict[str, Any]¶
Get complete model configuration including dual-sequence params. Extends parent’s model_config_dict with dual-sequence specific fields.
- validate_dual_sequence_hyperparameters()[source]¶
Validate dual-sequence specific hyperparameters. Calls parent validator first, then adds dual-sequence specific checks.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) – The BaseModel instance.
context (Any) – The context.