Skip to content

Dev peter#55

Merged
renierts merged 19 commits into
foundation_modelfrom
dev-peter
Feb 17, 2026
Merged

Dev peter#55
renierts merged 19 commits into
foundation_modelfrom
dev-peter

Conversation

@renierts
Copy link
Copy Markdown
Collaborator

No description provided.

Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).
…, the wrong configuration was used to find the correct signal name.

Also, removed warning for duplicated tensor conversion.
…s and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.
The basic encoders are now all working.

Examples are in scripts.
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.
…got to remove unused modalities. This follows the standard getitem function now.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.
@renierts renierts merged commit 6373b23 into foundation_model Feb 17, 2026
renierts added a commit that referenced this pull request Feb 17, 2026
* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
renierts added a commit that referenced this pull request Mar 2, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Mar 9, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Mar 10, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Added functionalities for preprocessing.
- Convert float64 to float32 in an existing H5 file
- Add new data from another H5 file to an existing target file

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Mar 10, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Added functionalities for preprocessing.
- Convert float64 to float32 in an existing H5 file
- Add new data from another H5 file to an existing target file

* Shell script for batch dtype conversion.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Mar 17, 2026
* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
renierts added a commit that referenced this pull request Mar 17, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Apr 1, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Apr 2, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
@renierts renierts mentioned this pull request Apr 2, 2026
renierts added a commit that referenced this pull request Apr 2, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Apr 13, 2026
* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
renierts added a commit that referenced this pull request Apr 13, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Apr 13, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request Apr 24, 2026
* Developed basic functionality for training loop.

* Reiterating on the dataset class.
The sequences are now not resampled to a common number of samples (1000) anymore.
Now, the number of samples is different for each diagnostic group.

TODO: Update the trainer class.

* Added an option to select a subset of input/target modalities.

* Remove demo script for DataLoader and model training. The file `run_demo.py` has been deleted as it is no longer needed for the current implementation.

* Remove main function and clean up run_demo.py formatting. The main function has been deleted as it is no longer needed, and the formatting of the HDF5 file path in run_demo.py has been improved for better readability.

* Restructured nn package.

* Added modules for encoder and latent space.

* Refactor data loading and demo scripts. Removed unused files, updated .gitignore, and added new demo script `run_demo_2.py` for demonstrating DataLoader and model training. Enhanced `pyproject.toml` with additional dependencies and fixed paths in existing scripts. Updated `data_loader.py` to improve dataset handling.

* Enhance data loading functionality by adding support for new input modalities and refining dataset handling. Updated `data_loader.py` to accommodate these changes and improved documentation for clarity.

* chore: Update `LICENSE` year and copyright holders

* chore: Move utility scripts to `utils/`

* chore: Add `.gitignore` for Python projects

https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Python.gitignore

* chore: Use `pixi` for package and environment management

* chore: Move notebooks and demo script to `./scripts/`

* chore: Add PyPI dependencies to `pyproject.toml`

* Added conv1d models for time-series encoding and spatio-temporal profiles (from TS CER for example).

* Bugfixes for shape progression in the baseline models.

* Added more parameters for the encoders.

* Fixed pre-computing statistics in the dataloader. This matches the new API now.

* Bugfix duplicated tensor conversions

* Removed profiler

* Removed loading the entire time vector. One more speed-up.

* feat: Add models and sample `xdata` for shape (#36)

* Added conv1d models for time-series encoding and spatio-temporal profiles (from TS CER for example).

* Bugfixes for shape progression in the baseline models.

* Added more parameters for the encoders.

* Fixed pre-computing statistics in the dataloader. This matches the new API now.

* Bugfix duplicated tensor conversions

* Removed profiler

* Removed loading the entire time vector. One more speed-up.

* - Added a trainer for pretraining autoencoder.
- Bugfix in the dataset class - __getitem__ was out-dated.
- Bugfix in video_baseline.py (link to the base classes was wrong)
- Added demo for fast_time_series_reconstruction.py

* Nathan fm (#42)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Dev peter (#43)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* some rebased changes

* Enhance DDP support in unimodal autoencoder training script

- Integrated DistributedManager for distributed training setup.
- Updated DataLoader to utilize DistributedSampler when in distributed mode.
- Adjusted logging levels based on the main process.
- Modified checkpointing to ensure directories are created only by the main process.
- Enhanced UnimodalTrainer to support distributed training and model wrapping.

* Dev aza (#59)

* use dev-peter. Older traner. Things seem to work.

* video pipeline ready to push. video model optimization in progress.

---------

Co-authored-by: Azarakhsh Jalalvand <aj17@stellar-vis2.princeton.edu>
Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Nathan fm (#60)

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Add README for modality models

* Update README and refactor modality models

- Added detailed sections in the README for data storage locations and Flash Attention installation instructions.
- Removed unused SpectrogramResLSTM classes and related imports from modality models.
- Introduced new Conv3dEncoderBlock and Conv3dDecoderBlock classes in the SpectrogramBaselineEncoder and SpectrogramBaselineDecoder for improved architecture.
- Enhanced SpectrogramBaselineEncoder and Decoder to support LSTM integration and modular block structures.

* Update README for clarity and accuracy

- Clarified instructions for activating the environment.
- Improved wording on Flash Attention benefits.
- Updated the description for the pre-downloaded wheel URL for Princeton clusters.

* Update README for improved clarity and structure

- Reorganized environment setup instructions for better readability.
- Enhanced the explanation of Flash Attention's benefits and usage.
- Updated links for Flash Attention wheel downloads to be more user-friendly.

* Refactor README and remove unused CER model

- Corrected spelling in the "Environment Setup" section and clarified the use of Pixi for environment management.
- Updated section titles for consistency, changing "Datas" to "Data."
- Removed the unused CER model implementation from the codebase to streamline the project.

* Update .gitignore to include secrets.toml for Streamlit

- Re-added .streamlit/secrets.toml to the .gitignore file to prevent tracking of sensitive information.
- Removed previous entries for .pixi/* while retaining .pixi/config.toml to maintain necessary configuration files.

* feat: Enhance drawing utilities and add NullDrawer for non-main processes

- Updated `__init__.py` to include `NullDrawer` in the module exports.
- Refactored `distributed.py` to improve DDP wrapping and added `unwrap` method.
- Enhanced `drawing.py` with a new `DrawerProtocol` and implemented `NullDrawer` for no-op drawing.
- Modified `DefaultDrawer` to streamline loss tracking and visualization.
- Added new scripts for SLURM job submissions for various training configurations.
- Introduced `spectrogram_tf_only.py` model with encoder-decoder architecture for spectrogram processing.
- Implemented new metrics for PSNR and SSIM in `metrics.py`.
- Created tracking utilities in `tracking.py` for better training progress monitoring and logging.

* feat: Add BigTFUNet model and configuration files

* feat: Implement SpectrogramTFAttnAutoEncoder with channel attention and gated target loss (also returned to normalized spectrum, non-normalized causing issues)

* Dev peter (#61)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#62)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#63)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Added functionalities for preprocessing.
- Convert float64 to float32 in an existing H5 file
- Add new data from another H5 file to an existing target file

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#64)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and star…
renierts added a commit that referenced this pull request Apr 24, 2026
* Dev peter (#73)

* Developed basic functionality for training loop.

* Reiterating on the dataset class.
The sequences are now not resampled to a common number of samples (1000) anymore.
Now, the number of samples is different for each diagnostic group.

TODO: Update the trainer class.

* Added an option to select a subset of input/target modalities.

* Remove demo script for DataLoader and model training. The file `run_demo.py` has been deleted as it is no longer needed for the current implementation.

* Remove main function and clean up run_demo.py formatting. The main function has been deleted as it is no longer needed, and the formatting of the HDF5 file path in run_demo.py has been improved for better readability.

* Restructured nn package.

* Added modules for encoder and latent space.

* Refactor data loading and demo scripts. Removed unused files, updated .gitignore, and added new demo script `run_demo_2.py` for demonstrating DataLoader and model training. Enhanced `pyproject.toml` with additional dependencies and fixed paths in existing scripts. Updated `data_loader.py` to improve dataset handling.

* Enhance data loading functionality by adding support for new input modalities and refining dataset handling. Updated `data_loader.py` to accommodate these changes and improved documentation for clarity.

* chore: Update `LICENSE` year and copyright holders

* chore: Move utility scripts to `utils/`

* chore: Add `.gitignore` for Python projects

https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Python.gitignore

* chore: Use `pixi` for package and environment management

* chore: Move notebooks and demo script to `./scripts/`

* chore: Add PyPI dependencies to `pyproject.toml`

* Added conv1d models for time-series encoding and spatio-temporal profiles (from TS CER for example).

* Bugfixes for shape progression in the baseline models.

* Added more parameters for the encoders.

* Fixed pre-computing statistics in the dataloader. This matches the new API now.

* Bugfix duplicated tensor conversions

* Removed profiler

* Removed loading the entire time vector. One more speed-up.

* feat: Add models and sample `xdata` for shape (#36)

* Added conv1d models for time-series encoding and spatio-temporal profiles (from TS CER for example).

* Bugfixes for shape progression in the baseline models.

* Added more parameters for the encoders.

* Fixed pre-computing statistics in the dataloader. This matches the new API now.

* Bugfix duplicated tensor conversions

* Removed profiler

* Removed loading the entire time vector. One more speed-up.

* - Added a trainer for pretraining autoencoder.
- Bugfix in the dataset class - __getitem__ was out-dated.
- Bugfix in video_baseline.py (link to the base classes was wrong)
- Added demo for fast_time_series_reconstruction.py

* Nathan fm (#42)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Dev peter (#43)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* some rebased changes

* Enhance DDP support in unimodal autoencoder training script

- Integrated DistributedManager for distributed training setup.
- Updated DataLoader to utilize DistributedSampler when in distributed mode.
- Adjusted logging levels based on the main process.
- Modified checkpointing to ensure directories are created only by the main process.
- Enhanced UnimodalTrainer to support distributed training and model wrapping.

* Dev aza (#59)

* use dev-peter. Older traner. Things seem to work.

* video pipeline ready to push. video model optimization in progress.

---------

Co-authored-by: Azarakhsh Jalalvand <aj17@stellar-vis2.princeton.edu>
Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Nathan fm (#60)

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Add README for modality models

* Update README and refactor modality models

- Added detailed sections in the README for data storage locations and Flash Attention installation instructions.
- Removed unused SpectrogramResLSTM classes and related imports from modality models.
- Introduced new Conv3dEncoderBlock and Conv3dDecoderBlock classes in the SpectrogramBaselineEncoder and SpectrogramBaselineDecoder for improved architecture.
- Enhanced SpectrogramBaselineEncoder and Decoder to support LSTM integration and modular block structures.

* Update README for clarity and accuracy

- Clarified instructions for activating the environment.
- Improved wording on Flash Attention benefits.
- Updated the description for the pre-downloaded wheel URL for Princeton clusters.

* Update README for improved clarity and structure

- Reorganized environment setup instructions for better readability.
- Enhanced the explanation of Flash Attention's benefits and usage.
- Updated links for Flash Attention wheel downloads to be more user-friendly.

* Refactor README and remove unused CER model

- Corrected spelling in the "Environment Setup" section and clarified the use of Pixi for environment management.
- Updated section titles for consistency, changing "Datas" to "Data."
- Removed the unused CER model implementation from the codebase to streamline the project.

* Update .gitignore to include secrets.toml for Streamlit

- Re-added .streamlit/secrets.toml to the .gitignore file to prevent tracking of sensitive information.
- Removed previous entries for .pixi/* while retaining .pixi/config.toml to maintain necessary configuration files.

* feat: Enhance drawing utilities and add NullDrawer for non-main processes

- Updated `__init__.py` to include `NullDrawer` in the module exports.
- Refactored `distributed.py` to improve DDP wrapping and added `unwrap` method.
- Enhanced `drawing.py` with a new `DrawerProtocol` and implemented `NullDrawer` for no-op drawing.
- Modified `DefaultDrawer` to streamline loss tracking and visualization.
- Added new scripts for SLURM job submissions for various training configurations.
- Introduced `spectrogram_tf_only.py` model with encoder-decoder architecture for spectrogram processing.
- Implemented new metrics for PSNR and SSIM in `metrics.py`.
- Created tracking utilities in `tracking.py` for better training progress monitoring and logging.

* feat: Add BigTFUNet model and configuration files

* feat: Implement SpectrogramTFAttnAutoEncoder with channel attention and gated target loss (also returned to normalized spectrum, non-normalized causing issues)

* Dev peter (#61)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#62)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#63)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Added functionalities for preprocessing.
- Convert float64 to float32 in an existing H5 file
- Add new data from another H5 file to an existing target file

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Dev peter (#64)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI o…
renierts added a commit that referenced this pull request May 4, 2026
* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Add README for modality models

* Update README and refactor modality models

- Added detailed sections in the README for data storage locations and Flash Attention installation instructions.
- Removed unused SpectrogramResLSTM classes and related imports from modality models.
- Introduced new Conv3dEncoderBlock and Conv3dDecoderBlock classes in the SpectrogramBaselineEncoder and SpectrogramBaselineDecoder for improved architecture.
- Enhanced SpectrogramBaselineEncoder and Decoder to support LSTM integration and modular block structures.

* Update README for clarity and accuracy

- Clarified instructions for activating the environment.
- Improved wording on Flash Attention benefits.
- Updated the description for the pre-downloaded wheel URL for Princeton clusters.

* Update README for improved clarity and structure

- Reorganized environment setup instructions for better readability.
- Enhanced the explanation of Flash Attention's benefits and usage.
- Updated links for Flash Attention wheel downloads to be more user-friendly.

* Refactor README and remove unused CER model

- Corrected spelling in the "Environment Setup" section and clarified the use of Pixi for environment management.
- Updated section titles for consistency, changing "Datas" to "Data."
- Removed the unused CER model implementation from the codebase to streamline the project.

* Update .gitignore to include secrets.toml for Streamlit

- Re-added .streamlit/secrets.toml to the .gitignore file to prevent tracking of sensitive information.
- Removed previous entries for .pixi/* while retaining .pixi/config.toml to maintain necessary configuration files.

* feat: Enhance drawing utilities and add NullDrawer for non-main processes

- Updated `__init__.py` to include `NullDrawer` in the module exports.
- Refactored `distributed.py` to improve DDP wrapping and added `unwrap` method.
- Enhanced `drawing.py` with a new `DrawerProtocol` and implemented `NullDrawer` for no-op drawing.
- Modified `DefaultDrawer` to streamline loss tracking and visualization.
- Added new scripts for SLURM job submissions for various training configurations.
- Introduced `spectrogram_tf_only.py` model with encoder-decoder architecture for spectrogram processing.
- Implemented new metrics for PSNR and SSIM in `metrics.py`.
- Created tracking utilities in `tracking.py` for better training progress monitoring and logging.

* feat: Add BigTFUNet model and configuration files

* feat: Implement SpectrogramTFAttnAutoEncoder with channel attention and gated target loss (also returned to normalized spectrum, non-normalized causing issues)

* Refactor video baseline autoencoder and implement multimodal prediction framework

- Refactored VideoBaselineEncoder and VideoBaselineDecoder to improve architecture and maintainability.
- Introduced VideoBaselineAutoEncoder to encapsulate encoder and decoder functionality.
- Added Stage3Trainer for training multimodal prediction models, handling inputs, targets, and observations.
- Implemented MultimodalPredictionModel combining a fusion transformer with forecasting heads for each modality.
- Created CombinedPredictionLoss to compute losses for both token-space and observation-space predictions.
- Added training scripts for unimodal and multimodal models, including support for SLURM job arrays.
- Updated model factory to accommodate new model parameters and defaults.

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Refactor training scripts and models

- Deleted unused training scripts: train_mhr_weighted_mse.sh, train_unimodal.sh, and spectrogram_tf_only.py.
- Updated train_unimodal_autoencoder.py to remove gated target loss functionality.
- Modified data_loader.py to adjust the default data directory and improve shot finding logic.
- Enhanced SlowTimeSeriesBaselineAutoEncoder to return both reconstructed output and tokens.
- Updated model_factory.py to change the modality type for 'ich' and 'i_coil' signals.
- Refactored UnimodalTrainer to simplify loss calculation.
- Added reset_epoch method to Tracker for better metric management.
- Introduced new training scripts for various signals (e.g., train_bolo_raw.sh, train_cer_rot.sh, etc.) with consistent configurations.

* feat: Add Wandb directory to .gitignore

* TS profiles are now slow time series instead of profiles.

* feat: Add ROCm support and update training scripts

- Updated `pyproject.toml` to include ROCm feature and dependencies for PyTorch and torchvision.
- Modified dataset loading in multiple training scripts to include `weights_only=False` when loading statistics.
- Renamed Filterscope models to FastTimeSeries models in the modality module.
- Added new Slurm scripts for training various signals using ROCm, including `train_bes.sh`, `train_bolo_raw.sh`, `train_cer_rot.sh`, `train_cer_ti.sh`, `train_co2.sh`, `train_ece.sh`, `train_filterscopes.sh`, `train_i_coil.sh`, `train_ich.sh`, `train_langmuir.sh`, `train_mhr.sh`, `train_mirnov.sh`, `train_mse.sh`, `train_neutron_rate.sh`, `train_sxr.sh`, `train_ts_core_density.sh`, `train_ts_core_temp.sh`, `train_ts_tangential_density.sh`, `train_ts_tangential_temp.sh`, and `train_vib.sh`.
- Added a setup script for ROCm environment validation.

* Refactor ROCm environment setup and training scripts

- Removed ROCm feature configuration from pyproject.toml.
- Updated SLURM job time limits from 4 hours to 20 minutes in multiple training scripts.
- Modified training scripts to activate the ROCm virtual environment before executing training commands.
- Enhanced loss function handling in UnimodalTrainer to accommodate optional valid_lengths parameter.

* Refactor SLURM training scripts and update training pipeline

- Reduced `--cpus-per-task` from 17 to 5 across multiple SLURM scripts.
- Decreased `--num_workers` for data loading in training scripts to optimize resource usage.
- Added a new script `generate_tokens.sh` for generating token datasets from trained autoencoders.
- Introduced `train_multimodal.sh` for training a multimodal predictor.
- Created `generate_token_dataset.py` to handle token generation from raw HDF5 files.
- Updated `README.md` to document the training pipeline stages and usage instructions.
- Enhanced `train_unimodal_autoencoder.py` to support model resumption and improved logging.
- Modified `filterscope_baseline.py` to allow adaptive pooling based on output shape.
- Added error handling in `drawing.py` for cases with no finite values during plotting.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* feat: Update ROCm training scripts and configurations for improved compatibility and logging

* Big changes. Now, the entire foundation model is trained jointly.
Too much to comment all.
Mainly, the old foundation model is in archive to be able to restore it at any point.
The new training scripts are train_e2e*.
Adapted dataset functionalities to be compatible with the new training approach.

* Much better GPU utilization of the e2d pipeline now (98% on a single GPU).

* Prepared for video data. 100fps works better with the 50ms chunks than 50fps. So, adapted it.

* feat: Add ROCm parallel-lane orchestrator and 2-GPU DDP launcher

submit_all.sh now distributes signals across two HIP_VISIBLE_DEVICES
lanes concurrently and samples amd-smi during runs. train_ddp.sh adds a
parameterized torchrun launcher that reaches 2.16x speedup on ECE over
the single-GPU path. train_bes.sh batch_size 8 -> 4 to clear the prior
HIP OOM. .gitignore excludes local logs/ and .claude/ session dirs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: AMD MI210 DDP support for E2E training stages 1-3

Patches the five train_e2e_stage*.py scripts to run under torchrun with
DistributedManager, DistributedSampler, and DDP-wrapped models, and adds
matching ROCm SLURM launchers in scripts/slurm_rocm/.

Stages 1, 2, and 2_delta wrap the high-level model or rollout directly.
Stages 2_extended and 3 introduce a small TrainStepModule wrapper because
their training paths bypass model.__call__; find_unused_parameters=True
keeps DDP happy under gradient checkpointing and LoRA. Validation runs on
all ranks in lockstep to avoid the broadcast_buffers deadlock that hits
when only rank 0 calls forward; only rank 0 logs and writes checkpoints.
Each stage smoke-tested end-to-end on 2x MI210.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>
Co-authored-by: renierts <ps9551@princeton.edu>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
renierts added a commit that referenced this pull request May 7, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Big changes. Now, the entire foundation model is trained jointly.
Too much to comment all.
Mainly, the old foundation model is in archive to be able to restore it at any point.
The new training scripts are train_e2e*.
Adapted dataset functionalities to be compatible with the new training approach.

* Much better GPU utilization of the e2d pipeline now (98% on a single GPU).

* Prepared for video data. 100fps works better with the 50ms chunks than 50fps. So, adapted it.

* Stage 2 is ready for video support.

* Prepared for real multi-model foundation model. TS+Video+Spectrograms.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
renierts added a commit that referenced this pull request May 10, 2026
* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Update training script for unimodal autoencoder to support distributed training

- Replaced `srun pixi run python` with `srun pixi run torchrun` for improved distributed execution.
- Added parameters for distributed training configuration in the training script.
- Included a comment in the UnimodalTrainer class to indicate the integration of distributed training support.

* Add README for modality models

* Update README and refactor modality models

- Added detailed sections in the README for data storage locations and Flash Attention installation instructions.
- Removed unused SpectrogramResLSTM classes and related imports from modality models.
- Introduced new Conv3dEncoderBlock and Conv3dDecoderBlock classes in the SpectrogramBaselineEncoder and SpectrogramBaselineDecoder for improved architecture.
- Enhanced SpectrogramBaselineEncoder and Decoder to support LSTM integration and modular block structures.

* Update README for clarity and accuracy

- Clarified instructions for activating the environment.
- Improved wording on Flash Attention benefits.
- Updated the description for the pre-downloaded wheel URL for Princeton clusters.

* Update README for improved clarity and structure

- Reorganized environment setup instructions for better readability.
- Enhanced the explanation of Flash Attention's benefits and usage.
- Updated links for Flash Attention wheel downloads to be more user-friendly.

* Refactor README and remove unused CER model

- Corrected spelling in the "Environment Setup" section and clarified the use of Pixi for environment management.
- Updated section titles for consistency, changing "Datas" to "Data."
- Removed the unused CER model implementation from the codebase to streamline the project.

* Update .gitignore to include secrets.toml for Streamlit

- Re-added .streamlit/secrets.toml to the .gitignore file to prevent tracking of sensitive information.
- Removed previous entries for .pixi/* while retaining .pixi/config.toml to maintain necessary configuration files.

* feat: Enhance drawing utilities and add NullDrawer for non-main processes

- Updated `__init__.py` to include `NullDrawer` in the module exports.
- Refactored `distributed.py` to improve DDP wrapping and added `unwrap` method.
- Enhanced `drawing.py` with a new `DrawerProtocol` and implemented `NullDrawer` for no-op drawing.
- Modified `DefaultDrawer` to streamline loss tracking and visualization.
- Added new scripts for SLURM job submissions for various training configurations.
- Introduced `spectrogram_tf_only.py` model with encoder-decoder architecture for spectrogram processing.
- Implemented new metrics for PSNR and SSIM in `metrics.py`.
- Created tracking utilities in `tracking.py` for better training progress monitoring and logging.

* feat: Add BigTFUNet model and configuration files

* feat: Implement SpectrogramTFAttnAutoEncoder with channel attention and gated target loss (also returned to normalized spectrum, non-normalized causing issues)

* Refactor video baseline autoencoder and implement multimodal prediction framework

- Refactored VideoBaselineEncoder and VideoBaselineDecoder to improve architecture and maintainability.
- Introduced VideoBaselineAutoEncoder to encapsulate encoder and decoder functionality.
- Added Stage3Trainer for training multimodal prediction models, handling inputs, targets, and observations.
- Implemented MultimodalPredictionModel combining a fusion transformer with forecasting heads for each modality.
- Created CombinedPredictionLoss to compute losses for both token-space and observation-space predictions.
- Added training scripts for unimodal and multimodal models, including support for SLURM job arrays.
- Updated model factory to accommodate new model parameters and defaults.

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* Refactor training scripts and models

- Deleted unused training scripts: train_mhr_weighted_mse.sh, train_unimodal.sh, and spectrogram_tf_only.py.
- Updated train_unimodal_autoencoder.py to remove gated target loss functionality.
- Modified data_loader.py to adjust the default data directory and improve shot finding logic.
- Enhanced SlowTimeSeriesBaselineAutoEncoder to return both reconstructed output and tokens.
- Updated model_factory.py to change the modality type for 'ich' and 'i_coil' signals.
- Refactored UnimodalTrainer to simplify loss calculation.
- Added reset_epoch method to Tracker for better metric management.
- Introduced new training scripts for various signals (e.g., train_bolo_raw.sh, train_cer_rot.sh, etc.) with consistent configurations.

* feat: Add Wandb directory to .gitignore

* TS profiles are now slow time series instead of profiles.

* feat: Add ROCm support and update training scripts

- Updated `pyproject.toml` to include ROCm feature and dependencies for PyTorch and torchvision.
- Modified dataset loading in multiple training scripts to include `weights_only=False` when loading statistics.
- Renamed Filterscope models to FastTimeSeries models in the modality module.
- Added new Slurm scripts for training various signals using ROCm, including `train_bes.sh`, `train_bolo_raw.sh`, `train_cer_rot.sh`, `train_cer_ti.sh`, `train_co2.sh`, `train_ece.sh`, `train_filterscopes.sh`, `train_i_coil.sh`, `train_ich.sh`, `train_langmuir.sh`, `train_mhr.sh`, `train_mirnov.sh`, `train_mse.sh`, `train_neutron_rate.sh`, `train_sxr.sh`, `train_ts_core_density.sh`, `train_ts_core_temp.sh`, `train_ts_tangential_density.sh`, `train_ts_tangential_temp.sh`, and `train_vib.sh`.
- Added a setup script for ROCm environment validation.

* Refactor ROCm environment setup and training scripts

- Removed ROCm feature configuration from pyproject.toml.
- Updated SLURM job time limits from 4 hours to 20 minutes in multiple training scripts.
- Modified training scripts to activate the ROCm virtual environment before executing training commands.
- Enhanced loss function handling in UnimodalTrainer to accommodate optional valid_lengths parameter.

* Refactor SLURM training scripts and update training pipeline

- Reduced `--cpus-per-task` from 17 to 5 across multiple SLURM scripts.
- Decreased `--num_workers` for data loading in training scripts to optimize resource usage.
- Added a new script `generate_tokens.sh` for generating token datasets from trained autoencoders.
- Introduced `train_multimodal.sh` for training a multimodal predictor.
- Created `generate_token_dataset.py` to handle token generation from raw HDF5 files.
- Updated `README.md` to document the training pipeline stages and usage instructions.
- Enhanced `train_unimodal_autoencoder.py` to support model resumption and improved logging.
- Modified `filterscope_baseline.py` to allow adaptive pooling based on output shape.
- Added error handling in `drawing.py` for cases with no finite values during plotting.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* feat: Update ROCm training scripts and configurations for improved compatibility and logging

* Big changes. Now, the entire foundation model is trained jointly.
Too much to comment all.
Mainly, the old foundation model is in archive to be able to restore it at any point.
The new training scripts are train_e2e*.
Adapted dataset functionalities to be compatible with the new training approach.

* Much better GPU utilization of the e2d pipeline now (98% on a single GPU).

* Prepared for video data. 100fps works better with the 50ms chunks than 50fps. So, adapted it.

* feat: Add ROCm parallel-lane orchestrator and 2-GPU DDP launcher

submit_all.sh now distributes signals across two HIP_VISIBLE_DEVICES
lanes concurrently and samples amd-smi during runs. train_ddp.sh adds a
parameterized torchrun launcher that reaches 2.16x speedup on ECE over
the single-GPU path. train_bes.sh batch_size 8 -> 4 to clear the prior
HIP OOM. .gitignore excludes local logs/ and .claude/ session dirs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat: AMD MI210 DDP support for E2E training stages 1-3

Patches the five train_e2e_stage*.py scripts to run under torchrun with
DistributedManager, DistributedSampler, and DDP-wrapped models, and adds
matching ROCm SLURM launchers in scripts/slurm_rocm/.

Stages 1, 2, and 2_delta wrap the high-level model or rollout directly.
Stages 2_extended and 3 introduce a small TrainStepModule wrapper because
their training paths bypass model.__call__; find_unused_parameters=True
keeps DDP happy under gradient checkpointing and LoRA. Validation runs on
all ranks in lockstep to avoid the broadcast_buffers deadlock that hits
when only rank 0 calls forward; only rank 0 logs and writes checkpoints.
Each stage smoke-tested end-to-end on 2x MI210.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* infra: Frontier SLURM scripts + GPU/CPU/indexing profilers

- 5 simple production launchers (1x8 default, hand-editable):
  train_e2e_{stage1,stage2,stage2_delta,stage2_extended,stage3}.sh
- 20 shape-matrix launchers for DDP smoke testing:
  train_e2e_<stage>_{1x1,1x8,Nx1,NxN}.sh, with SMOKE=1 + PROFILE=1 hooks
- Profiling sidecar: rocm-smi (GPU util/VRAM/power) + mpstat (CPU) at 1Hz
  via srun --overlap, with _summarize_profile.py aggregator
- profile_indexing.py / profile_indexing.sh: CPU-only timing of
  build_datasets file-length pass; predicts full-pass duration and
  optionally pre-populates lengths cache for training jobs
- _frontier_common.sh: shared module loads, RCCL/MIOpen knobs, MASTER_ADDR
- _srun_rank_wrapper.sh: per-rank env setup mapping SLURM -> torch.distributed
- gitignore: envs/ (21GB conda) and profile/ (session output)

* fix: Frontier --gpus-per-task=1 DDP device indexing

Each rank sees only 1 GPU (masked by ROCR_VISIBLE_DEVICES) so the device
index is always 0 regardless of LOCAL_RANK. Add a `visible > 1` clamp in
DistributedManager.device_index and use it everywhere device_id flows.
Apply the same fix to the explicit DDP wraps in stage 2_extended / stage 3
that used local_rank directly.

* fix(stage1): unwrap DDP for model.diagnostics access in validate + freeze release

After the foundation_model merge, validate() at line 597 dereferenced
model.diagnostics directly, which AttributeError's under DDP. Same shape
of bug at line 1177 for _release_module_freeze (its sibling _apply at
line 1127 was already correct). Both now go through _core(model).

* infra(frontier): switch from conda env to pixi shell-hook activation

- pyproject.toml: extract the cu124 torch from base pypi-deps into a
  `cuda` feature; add a `frontier` feature with ROCm 7.1 wheels. envs:
    default  = ["cuda"]      (Princeton/CUDA workflow unchanged)
    fdp      = ["fdp","cuda"] (also unchanged)
    frontier = ["frontier"]   (new — Frontier ROCm)
- _frontier_common.sh: drop miniforge3 module + `conda activate`; instead
  put `~/.pixi/bin` on PATH and eval `pixi shell-hook -e frontier`.
- All 27 SLURM scripts: drop the now-orphan `conda activate $CONDA_ENV_PATH`
  line (the common.sh hook handles env activation by itself).

One-time bootstrap on a login node (after pulling):
    pixi install -e frontier

Performance is identical to the prior conda env — same PyTorch ROCm
wheels, just installed via uv instead of conda.

* fix(pixi): pin frontier torch/torchvision to rocm7.1 wheel index versions

rocm7.1 wheels only publish torch 2.10.0 paired with torchvision 0.25-0.26;
the original ">=2.5.1,<2.11" / ">=0.20.1,<0.22" pins didn't intersect.
Also list triton-rocm as an explicit dep — torch 2.10 declares it but uv
doesn't auto-discover it through a per-package index spec.

* chore: remove obsolete setup_frontier_env.sh

The conda-env bootstrap is superseded by `pixi install -e frontier`
(see _frontier_common.sh). Deleted the 21GB conda env at envs/
locally too; that path was already gitignored.

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>
Co-authored-by: renierts <ps9551@princeton.edu>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Nathaniel Chen <nchen@login08.frontier.olcf.ornl.gov>
renierts added a commit that referenced this pull request May 11, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------

Co-authored-by: Peter Steiner <61472983+renierts@users.noreply.github.com>

* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>

* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>

* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Big changes. Now, the entire foundation model is trained jointly.
Too much to comment all.
Mainly, the old foundation model is in archive to be able to restore it at any point.
The new training scripts are train_e2e*.
Adapted dataset functionalities to be compatible with the new training approach.

* Much better GPU utilization of the e2d pipeline now (98% on a single GPU).

* Prepared for video data. 100fps works better with the 50ms chunks than 50fps. So, adapted it.

* Stage 2 is ready for video support.

* Prepared for real multi-model foundation model. TS+Video+Spectrograms.

* Prepared for real multi-model foundation model. TS+Video+Spectrograms.

* Code changes in the e2e training pipeline.

* Forgot to add multimodal.py that offers a better structure for multimodal training.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
@renierts renierts mentioned this pull request May 11, 2026
renierts added a commit that referenced this pull request May 11, 2026
* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------




* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Adapted the other reconstruction scripts to match the new API.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

* Dev peter (#68) (#69)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

* Foundation model (#56)

* Nathan fm (#53)

* chore: Update `pyproject.toml` to reorder authors, enhance README with environment setup instructions, and add validation notes in `validation.txt`. Refactor `dummy_model_2.py` for improved modality configuration and introduce `TextEncoder` enhancements in `text_baseline.py`.

* Refactor demo scripts to utilize new `Prediction4FusionModel` and `DictMSELoss`. Update `run_demo_2.py` and `run_demo_3.py` for improved model initialization and data handling. Enhance `TokamakH5Dataset` to handle degenerate signals and improve data extraction logic. Remove unused `latent_space.py` and integrate new modality fusion models in `modality_fusion.py`.

* Remove unused shot list configuration files and refactor trainer class to introduce MultimodalTrainer and UnimodalTrainer for improved training structure.

* Refactor modality models and trainer classes for improved structure and functionality. Removed unused TimeSeriesEncoder and Decoder, introduced FastTimeSeriesEncoder and SpectrogramAutoEncoder. Updated UnimodalTrainer to support logging and checkpoint management. Enhanced TokamakH5Dataset for better data handling and added checkpoint loading functionality in spectrogram reconstruction script.

* Add padding collate function and update training script for unimodal autoencoder

- Introduced `collate_fn_pad` to handle variable-length tensors in batches.
- Updated `train_unimodal_autoencoder.py` to use the new collate function.
- Modified `train_unimodal.sh` to include additional signal modalities for training.
- Added new autoencoder classes for fast time series and spatial profile modalities, ensuring output shape consistency with adaptive pooling.
- Enhanced video autoencoder implementation for better reconstruction quality.

* Remove spectrogram reconstruction script and refactor modality models

- Deleted `spectrogram_reconstruction.py` as part of the restructuring.
- Refactored modality models to introduce baseline versions for actuator, slow time series, fast time series, spatial profile, spectrogram, and video.
- Updated model registry and signal-to-model mappings to reflect new baseline architecture.
- Enhanced `TokamakH5Dataset` to support additional parameters for FFT and hop length.
- Improved training script for unimodal autoencoders to utilize new baseline models and added support for variable-length tensors.

* Update .gitignore to include pixi environments and add link to HSI-compression-benchmark in SpectrogramBaselineAutoEncoder docstring

* Remove unused shot list files and delete deprecated scripts for training and data handling

* Remove deprecated training scripts for CO2, ECE, MHR, and unimodal training

* Dev peter (#48)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Dev peter (#50)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

---------



* Dev peter (#55)

* Removed the argument "batch_size" from the trainers.
Changed default hyperparameters in the models.
Added demo for profile reconstruction.
Added script for dataset standardization (has to be run once before model training to store normalization coefficients).

* Bugfix in the dataset class. When iterating over movie configurations, the wrong configuration was used to find the correct signal name.
Also, removed warning for duplicated tensor conversion.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Added base script for video reconstruction. Copied from Aza's branch for debugging purposes.

* Minor changes in the example scripts. More preprocessing options for the dataset class.

* Fixed a bug where the dataset class failed when using multiple workers and opening an H5 file prior to distributing the dataset across all workers.

Significant updates in the Fast time series baseline and actuator reconstruction classes.

* Lots of bugfixes in the dataset, trainer, and models.
The basic encoders are now all working.

Examples are in scripts.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Extended checkpointing - the trainer stores now:
- Model
- Optimizer state
- Scheduler state
- Current loss
- Current epoch

For the sake of continual training.

* Adapted the other reconstruction scripts to match the new API.

* Bugfix in the dataset class. When splitting inputs and targets, I forgot to remove unused modalities. This follows the standard getitem function now.

* Prepared an option to preprocess movies. This has to be fully integrated!!!

* Added a baseline fusion transformer for latent space prediction.
Quick fix for the data standardization. Invalid values have to be ignored.
Fix in the function to create H5 files. bolo data does not have to be flipped anymore as the data is now stored in the correct format.

---------



* Moved some remaining scripts to the correct subdirectories.

* Still working on preparing the dataset. This is not ready to push. Preparation to moving to Stellar.

* Updated the data loader. Bugfix for loading the correct slices from H5 files.

Implemented calculating incremental statistics.

Corrected values in the modality configuration.

Removed redundant script standardize_dataset.py

* Added scripts for data fetching in Omega.
TODO: Write a documentation.

* Added a documentation for setting up Globus CLI on Omega and start a simple file transfer.

* Updated README.md:
- Added information on how to use all the scripts for data fetching.

Updated read_mds.sh
- Added a switch for globus file transfer. This simply stores the H5 files on Omega and we can add more data later.

* More PTData to fetch.

* PEP-8 compatible code.
Moved prepare_data.py to scripts, added a batch script to do this on compute nodes.
Added more point names to the data fetching scripts for Omega.
Added docstring to the WelfordTensor class.
Updated modalities.yaml with the new point names added.

* Generalized make_preprocessing_stats.py and made the function compute_preprocessing_stats more transparent.
Bugfix in modalities.yaml - Channels were missing in ECE.

* A lot of bugfixes in the dataloader and prepare_data.py

* Many bugfixees in the dataset class and for computing preprocessing stats. This is still not efficient enough and causes memory issues.

* Speed-ups in data_loader.py.

* Speed-ups in the dataloader.
Bugfixes in the trainer.
Cosmetic changes in tracking.py

* drawing.py:
- PEP-8 corrections
- Support plots of time signals and videos

Train-val-test split in fast_time_series_reconstruction.py

* Bugfix in processing methods of the dataloader:
- Channels was not handled properly (if selecting slices of a signal).
- Drawing: Restrict plotting to valid signals (not the padded sections after the actual signal).
- Introduced masked loss for fast time series reconstruction.

* Added a separate baseline encoder for filterscopes (renamed fast_time_series_baseline.py to filterscope_baseline.py).
Updates in the dataset class: Clipping for log transform can go down to -.99 (sufficient because we subtract 1.0).
Updates in drawing.py: We can now draw all kinds of different plots (except for profiles for now). Added functionality to draw correlation plots, which is important for finding feature distributions.
Added masked loss functions to not consider out-of-range time slices for training.

* Added a weighted loss to penalize target distributions.
Corrected the R2 score calculation in the drawer.
Renamed profile_reconstruction.py to mse_profile_reconstruction.py
Added ts_core_density_profile_reconstruction.py

* Modified the default parameters of some profile and time-series signals in data_loader.py
Added more loss functions in loss.py
Switched to HuberLoss in filterscopes_reconstruction.py, in mse_profile_reconstruction.py.
Updated model_factory.py to completed signal encoders/decoders.
Moved profile_baseline.py into modality.
Added training scripts for thomson scattering profiles.

* Added CER related info to the dataset class and to the model factory.

* Added dummy perceiver stuff. Be careful - this is not structured nicely yet. Only work in progress.

* Added more RMP point names to the data fetching script.
Restarted work on the latent feature space.

* Updated all scripts according to the increased set of diagnostics and actuators we are using.

* Updated preprocessing_stats. Here, the statistics are now pre-calculated for both, linear and log10 scale.
Working on more accurate autoencoders for time-series and profiles.

---------




* TS profiles are now slow time series instead of profiles.

* Had to update all the profiles and slow time-series. The latent feature space is more compact now.
Added foundation model utilities. This is under development!!!

* Big changes. Now, the entire foundation model is trained jointly.
Too much to comment all.
Mainly, the old foundation model is in archive to be able to restore it at any point.
The new training scripts are train_e2e*.
Adapted dataset functionalities to be compatible with the new training approach.

* Much better GPU utilization of the e2d pipeline now (98% on a single GPU).

* Prepared for video data. 100fps works better with the 50ms chunks than 50fps. So, adapted it.

* Stage 2 is ready for video support.

* Prepared for real multi-model foundation model. TS+Video+Spectrograms.

* Prepared for real multi-model foundation model. TS+Video+Spectrograms.

* Code changes in the e2e training pipeline.

* Forgot to add multimodal.py that offers a better structure for multimodal training.

---------

Co-authored-by: Nathaniel Chen <nathanchen1101@gmail.com>
Co-authored-by: renierts <ps9551@princeton.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant