LWMTemporal Examples
This directory contains example scripts demonstrating how to use the LWMTemporal package.
Quick Start Examples
1. Masked Reconstruction (example_reconstruction.py)
Demonstrates how to:
- Load wireless channel data
- Tokenize complex channels
- Mask random positions
- Reconstruct using the pretrained model
python examples/example_reconstruction.py
2. Channel Prediction Inference (inference_channel_prediction.py)
Run inference with a fine-tuned channel prediction model:
python examples/inference_channel_prediction.py
Expected output: Per-step NMSE around -20 dB
3. Train Channel Prediction (train_channel_prediction.py)
Fine-tune the model for channel prediction:
python examples/train_channel_prediction.py
This will:
- Load pretrained weights
- Fine-tune on your dataset
- Save checkpoints to
models/ - Generate visualizations in
figs/predictions/
Using the CLI
The package also provides command-line interfaces:
Channel Prediction
python -m LWMTemporal.cli.channel_prediction \
--data_path examples/data/city_8_tempe_3p5_20_32_32.p \
--pretrained checkpoints/m18_cp.pth \
--inference_only \
--val_limit 100 \
--device cpu
Pretraining
python -m LWMTemporal.cli.pretrain \
--data_dir examples/data/ \
--save_prefix models/pretrained \
--epochs 100 \
--batch_size 32 \
--device cuda
Data Format
Example data files are in examples/data/. See examples/data/README.md for details on the expected format.
Checkpoints
Pretrained checkpoints are in checkpoints/. See checkpoints/README.md for available models and loading instructions.