|
Algorithm 1 Two-Stage Self-Supervised Training Pipeline |
| Input: Normal training set ; hyperparameters m, , , ,
|
|
| % — Stage 1a: CSD Transformer Pre-training —
|
| 1: for epoch
to
do
|
| 2: Construct positive pairs from temporally adjacent CSD matrices
|
| 3: Generate hard negatives by injecting orthogonality noise into P–V coupling blocks
|
| 4: Update CSD Transformer via
|
| 5: end for
|
|
| % — Stage 1b: Temporal VQ-VAE Pre-training —
|
| 6: for epoch
to
do
|
▹ Early stopping, patience = 15 |
| 7: Update VQ-VAE via
|
| 8: end for
|
|
▹ StatFusion receives no gradient in Stage 1 |
|
| % — Stage 2: Conditional Joint Fine-tuning —
|
| 9: Load pre-trained CSD Transformer and VQ-VAE weights; randomly initialise fusion, gating, StatFusion |
| 10: for epoch
to
do
|
| 11: if epoch
then
|
▹ Gating warm-up |
| 12:
|
▹ Fixed weights |
| 13: else
|
| 14: gating network output (Equation (22)) |
| 15: end if
|
| 16:
|
| 17: Update all parameters end-to-end |
▹ Gradients flow to StatFusion via MHCA |
| 18: end for
|
|
| Output: Trained model; discard VQ-VAE decoder for inference |