RML2016.10A - Transformer (3 encoders, no convolution) - QPSK step-by-step flow (Kaggle)
Model: /kaggle/input/datasets/tiodomm/mrt-3-encoder-checkpoint/MRT_enc3_checkpoint/TransformerNoConv/best_model.pt  (epoch 106, 601,995 parameters)
==============================================================================

Input 2x128 I/Q -> 8 patches (8x32) -> Linear 32->128 -> class token + position (9x128)
-> 3 pre-norm encoders (4 heads, FFN 512, GELU) -> final LayerNorm -> class token -> Linear 128->11

QPSK signal: QPSK, 18 dB, sample 18 (dataset index 199018, test split)
Prediction : 9 = QPSK   probability = 0.926455
Stages     : 12 PASS / 0 FAIL (max error 6.22e-06)

TEST SET (44,000 signals)        CSV-weight NumPy   PyTorch (training run)
Test accuracy (all SNR)  :       62.60%           62.60%
Mean accuracy SNR >= 0 dB:       92.06%           92.06%
Accuracy at +18 dB       :       92.59%           92.59%
(differences of a few signals = float64 CPU vs float32 GPU rounding on borderline signals)

6-encoder model for comparison: 62.76 % all SNR, 92.60 % SNR >= 0 dB, 93.36 % at +18 dB (1,196,811 parameters)

FOLDERS
01_training/            best_model.pt, training history, results, scripts, split + normalization
02_reference_outputs/   RML2016.10A_reference_outputs: stage outputs of the QPSK signal
                        02_preprocessed, 04_patches, 05_embeddings, 06_encoder_outputs,
                        07_classifier, 08_predictions, 10_verification
03_weight_export/       MRTransformer_RML2016: best_model.pt exported to CSV (encoder_0..2,
                        also Wq/Wk/Wv/bq/bk/bv split files) + PyTorch reference outputs
04_verification/        verification_output: python_calculated + report
05_test_results/        accuracy_vs_snr, confusion_matrix_all_snr, confusion_matrix_plus18dB
06_function_sheet/      RML2016_Transformer_Functions.xlsx
